mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +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:
parent
b77c379441
commit
b2dc11940f
1 changed files with 2 additions and 6 deletions
|
@ -108,7 +108,8 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
|
|
||||||
if (!$logs) {
|
if (!$logs) {
|
||||||
// In Mercurial, we support operations against uncommitted changes.
|
// In Mercurial, we support operations against uncommitted changes.
|
||||||
return $this->getWorkingCopyRevision();
|
$this->setRelativeCommit($this->getWorkingCopyRevision());
|
||||||
|
return $this->relativeCommit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$outgoing_revs = ipull($logs, 'rev');
|
$outgoing_revs = ipull($logs, 'rev');
|
||||||
|
@ -281,11 +282,6 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
private function getDiffOptions() {
|
private function getDiffOptions() {
|
||||||
$options = array(
|
$options = array(
|
||||||
'--git',
|
'--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(),
|
'-U'.$this->getDiffLinesOfContext(),
|
||||||
);
|
);
|
||||||
return implode(' ', $options);
|
return implode(' ', $options);
|
||||||
|
|
Loading…
Reference in a new issue