From: epriestley Date: Wed, 9 Nov 2011 02:21:19 +0000 (-0800) Subject: Disable "color" extension in Mercurial in an extension-agnostic way X-Git-Tag: conduit-4~241 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=8a7e0b77836f5a3220319c9038453d6a226e6337;p=arcanist.git 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 --- diff --git a/src/repository/api/mercurial/ArcanistMercurialAPI.php b/src/repository/api/mercurial/ArcanistMercurialAPI.php index 23133ca5..a8f2752d 100644 --- a/src/repository/api/mercurial/ArcanistMercurialAPI.php +++ b/src/repository/api/mercurial/ArcanistMercurialAPI.php @@ -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);