]> khamidou — GitHub mirrors - arcanist.git/commit
Make arc land for hg more robust to failures
authordurham <durham@fb.com>
Wed, 20 Mar 2013 22:06:10 +0000 (15:06 -0700)
committerdurham <durham@fb.com>
Wed, 20 Mar 2013 22:06:10 +0000 (15:06 -0700)
commit9963323b91193bb98294516760b67ff3c11363a1
tree3d88c0c79a78d6eddb43549dfba4b60f24929253
parentb6e83c7b3523fe62e7ff9c7622a4d6243571edd8
Make arc land for hg more robust to failures

Summary:
Adds error handling for several kinds of failure in arc land for
mercurial.  Previously it would often leave the repo in a confusing state
if something failed.

- Aborts the land if pull brings in a diverged 'onto' branch.
- Aborts the rebase if there is a conflict. This leaves the repo exactly as
it was before, so the user is not left with a half finished rebase.
- Don't delete the original non-squashed branch until the push succeeds.
- If the push fails, strip the temporary squashed commit. This leaves the
'onto' branch back on the latest commit from the server, and leaves the users
original nonsquashed branch around.
- Always leave the user back on their original branch after an error.

Test Plan:
Ran arc land:
- with pull causing a diverged 'onto' bookmark
- with the 'onto' bookmark already diverged
- with the rebase causing conflicts
- with a push that failed due to a commit hook
- with a successful land
- with a successful collapse and land

In all failure cases the repo was left exactly as it was before arc land,
except for the push-failed case, where the only change was that the branch
was correctly on top of the destination branch due to a successful rebase.

Used bookmark name "foo bar-gah" to test that crazy bookmark names still work.

Reviewers: epriestley, dschleimer, sid0

Reviewed By: epriestley

CC: nh, wez, bos, aran, Korvin
Differential Revision: https://secure.phabricator.com/D5394
src/workflow/ArcanistLandWorkflow.php