]> khamidou — GitHub mirrors - arcanist.git/commit
Set relative commit early in "arc diff"
authorepriestley <git@epriestley.com>
Fri, 23 Mar 2012 00:22:52 +0000 (17:22 -0700)
committerepriestley <git@epriestley.com>
Fri, 23 Mar 2012 00:22:52 +0000 (17:22 -0700)
commit3bff9417e9a4ed8a447724e02f1d7402f5908036
treeaf3043b6cbc77d094b00ad4df2ff57af1ffe320e
parent87308eb34e77bf769437dcb647591dd9f44c5df3
Set relative commit early in "arc diff"

Summary:
In Mercurial, we figure out if the working copy is dirty with "hg diff", and do a somewhat expensive merge-base / outgoing operation if the relative commit isn't set. We can set the relative commit earlier and avoid some extra work.

We also may incorrectly cache this state (diff from merge-base of outgoing to tip) and pass the wrong rev and file dirty list to the linters.

Test Plan: Made commits which changed (A, B) and then (A). Ran "arc diff tip^". Before this change, observed full outgoing + merge base resolve and both "A" and "B" passed to lint. Observed execution of fewer commands and lint executing against "A" only after this change.

Reviewers: Makinde, btrahan

Reviewed By: Makinde

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D1998
src/repository/api/mercurial/ArcanistMercurialAPI.php
src/workflow/diff/ArcanistDiffWorkflow.php