Fixes T13668
There are two issues which prevent cascading/rebasing of non-landed commits during a land,
- ArcanistLandEngine repeatedly called cascadeState() passing in the last commit set and not any intermediary sets, resulting in failing to cascade branches made off of intermediate sets/revisions.
- ArcanistMercurialLandEngine::cascadeState() unconditionally tried to rebase each child branch from a given set onto the last published commit.
To fix these,
- Updated ArcanistLandEngine to pass in each set that needs cascaded.
- For Mercurial repositories, whenever a merge is executed, keep a map of the old commit to the destination/squashed commit. During cascading, reference this map for two purposes:
- If a child branch from a commit set has a corresponding new commit from the squash, ignore/avoid cascading since it was part of the land process. Attempting to rebase this would result in rebase conflicts.
- For a child branch that does need cascaded, determine the appropriate destination commit so it rebases cleanly.