Refs T13546
When using `arc land` in a mercurial repository (with `history.immutable = false`) the resulting working state is not currently expected:
1. The `--onto` bookmark will not have advanced to the newly pushed commit(s)
2. The working directory will typically be the old `--onto` changeset
A more intuitive resulting state would beThis change updates the behavior which should usually be generally expected:
1. Advance the `--onto` bookmarks, which could be accomplished by `hg pull -B [bookmark1] -B [bookmark2] ...` after landing (though there's a window of opportunity that this would pull additional changes down, but this would likely be fine in most cases?)
2. Prior to rebasing for land, track the current working directory changeset. If after successfully landing that changeset still exists then restore to that state, otherwise update to the new `--onto` location (first if there are multiple?)
In order to do this a few updates to `ArcanistMercurialLandEngine` need made
1.During the merge/rebase, The `newPushCommands()` needs to return a set of commands to run when the push has succeeded vsif the pre-workflow local state's active commit is merged/rebased then track that commit for use in `reconcileLocalState()`. when it has failed,During `reconcileLocalState()` update the working directory to the new commit (or onto-marker bookmark if applicable) as long as there was only a single onto-marker destination. as we should not be pulling bookmarks if the push failedIf the working directory is landed onto multiple destinations then the desired updated state is ambiguous.
2. After pushing, the current state of the repository will need to be captured in order to choose a good working state to update to, which can't be expressed as a command in an array.