]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Use hg phases to detect outgoing when phases are supported
authordurham <durham@fb.com>
Fri, 1 Mar 2013 22:10:25 +0000 (14:10 -0800)
committerdurham <durham@fb.com>
Fri, 1 Mar 2013 22:10:25 +0000 (14:10 -0800)
Summary:
There was an accidental ! in the phase vs outgoing condition
which caused it to use 'hg outgoing' when it should have used the draft()
phase.  Fixing this shaves 4.5 seconds off 'arc diff' on large repos.

Test Plan:
Ran arc diff --trace.  Noted that the draft() was used and that the diff
contained the correct files and commit.

Reviewers: epriestley

Reviewed By: epriestley

CC: sid0, bos, dschleimer, aran, Korvin
Differential Revision: https://secure.phabricator.com/D5182

src/repository/api/ArcanistMercurialAPI.php

index 359d61b2c1494e4795629fef2702944a906e914c..78f1cf5a29d3051c5e3a9d465130d309a5d017eb 100644 (file)
@@ -115,7 +115,7 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
     // Mercurial 2.1 and up have phases which indicate if something is
     // published or not. To find which revs are outgoing, it's much
     // faster to check the phase instead of actually checking the server.
-    if (!$this->supportsPhases()) {
+    if ($this->supportsPhases()) {
       list($err, $stdout) = $this->execManualLocal(
         'log --branch %s -r %s --style default',
         $this->getBranchName(),