1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-23 14:00:55 +01:00

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
This commit is contained in:
epriestley 2012-05-04 15:46:10 -07:00
parent b77c379441
commit b2dc11940f

View file

@ -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);