From: epriestley Date: Fri, 4 May 2012 22:46:10 +0000 (-0700) Subject: Clean up some "arc" edge cases in Mercurial X-Git-Tag: conduit-4~23 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=b2dc11940f80d377afa2e51352fcaf0a9c63dc22;p=arcanist.git Clean up some "arc" edge cases in Mercurial Summary: - We no longer need color options since we fake our way through parsing ANSI colorized diffs and use HGPLAIN (on Windows, too!). Drop 'em. - In the case where you have nothing outgoing, we don't cache the relative commit and thus run "hg outgoing" too many times, which is fairly slow (even if you have nothing outgoing). Cache it. Test Plan: Ran "arc diff --trace" in a mercurial working copy with nothing outgoing; verified we run "hg outgoing" only once. Reviewers: Makinde, csilvers, btrahan Reviewed By: Makinde CC: aran Differential Revision: https://secure.phabricator.com/D2399 --- diff --git a/src/repository/api/mercurial/ArcanistMercurialAPI.php b/src/repository/api/mercurial/ArcanistMercurialAPI.php index 98f5176a..b2d6150e 100644 --- a/src/repository/api/mercurial/ArcanistMercurialAPI.php +++ b/src/repository/api/mercurial/ArcanistMercurialAPI.php @@ -108,7 +108,8 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { if (!$logs) { // In Mercurial, we support operations against uncommitted changes. - return $this->getWorkingCopyRevision(); + $this->setRelativeCommit($this->getWorkingCopyRevision()); + return $this->relativeCommit; } $outgoing_revs = ipull($logs, 'rev'); @@ -281,11 +282,6 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { private function getDiffOptions() { $options = array( '--git', - // NOTE: We can't use "--color never" because that flag is provided - // by the color extension, which may or may not be enabled. Instead, - // set the color mode configuration so that color is disabled regardless - // of whether the extension is present or not. - '--config color.mode=off', '-U'.$this->getDiffLinesOfContext(), ); return implode(' ', $options);