]> khamidou — GitHub mirrors - arcanist.git/commit
Restore order of operations after D4056
authorepriestley <git@epriestley.com>
Tue, 4 Dec 2012 00:31:45 +0000 (16:31 -0800)
committerepriestley <git@epriestley.com>
Tue, 4 Dec 2012 00:31:45 +0000 (16:31 -0800)
commit886c1721dda481a19c89d7ba834e565c943cc55f
tree40e73f7141fcce79decb6c3e5e8e2cb59ea4f3e1
parente8eacb6ae3b3138bc4d89ca4cd6b2f0a7501eb86
Restore order of operations after D4056

Summary:
See discussion in D4056. In `findRevision()` we call `loadWorkingCopyDifferentialRevisions()`. However, this method depends upon the state of the working copy, because the end of the commit range it examines is HEAD. Prior to D4056 we checked out the target branch before calling `findRevision()`; after D4056 we call it earlier.

This isn't problematic in the `arc land` case, but in the `arc land <branch>` case it means we may fail to identify a revision, or identify the wrong revision, because HEAD isn't where we expect it to be.

Instead, unconditionally check out the target branch before finding the revision.

See <http://dl.dropbox.com/u/116385/Slingshot/Pictures/Screen%20Shot%202012-12-03%20at%203.43.45%20PM.png> for a transcript of the issue.

Test Plan: Reproduced issue as per link above. Ran `arc land --keep-branch --hold somebranch` successfully after this patch.

Reviewers: DurhamGoode, zeeg

Reviewed By: DurhamGoode

CC: aran
Differential Revision: https://secure.phabricator.com/D4072
src/workflow/ArcanistLandWorkflow.php