1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Disable "color" extension in Mercurial in an extension-agnostic way

Summary:
In D1079, I added "--color never", but this flag is provided by the "color"
extension, which is why I missed it originally, because it doesn't show up until
you enable that extension. Providing it causes installs which don't have it
enabled (disabled is the default) to fail.

Use "--config" to disable color instead. This sets a configuration setting and
works regardless of whether the color extension is present.

Test Plan: Ran "arc diff" in a mercurial working copy with the color extension
enabled and disabled.

Reviewers: Makinde, jungejason, nh, tuomaspelkonen, aran

Reviewed By: nh

CC: aran, nh

Differential Revision: 1092
This commit is contained in:
epriestley 2011-11-08 18:21:19 -08:00
parent a5bd88e5cb
commit 8a7e0b7783

View file

@ -226,7 +226,11 @@ class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
private function getDiffOptions() {
$options = array(
'--git',
'--color never',
// 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);