Mercurial > hg
diff mercurial/help/config.txt @ 32102:9a85ea1daf49 stable
color: turn 'ui.color' into a boolean (auto or off)
Previously, 'ui.color=yes' meant "always show color", While
"ui.color=auto" meant "use color automatically when it appears
sensible".
This feels problematic to some people because if an administrator has
disabled color with "ui.color=off", and a user turn it back on using
"color=on", it will get surprised (because it breaks their output when
redirected to a file.) This patch changes ui.color=true to only move the
default value of --color from "never" to "auto".
I'm not really in favor of this changes as I suspect the above case will
be pretty rare and I would rather keep the logic simpler. However, I'm
providing this patch to help the 4.2 release in the case were others
decide to make this changes.
Users that want to force colors without specifying --color on the
command line can use the 'ui.formatted' config knob, which had to be
enabled in a handful of tests for this patch.
Nice summary table (credit: Augie Fackler)
That is, before this patch:
+--------------------+--------------------+--------------------+
| | not a tty | a tty |
| | --color not set | --color not set |
| | | |
+--------------------+--------------------+--------------------+
| [ui] | | |
| color (not set) | no color | no color |
| | | |
+--------------------+--------------------+--------------------+
| [ui] | | |
| color = auto | no color | color |
| | | |
+--------------------+--------------------+--------------------+
| [ui] | | |
| color = yes | *color* | color |
| | | |
+--------------------+--------------------+--------------------+
| [ui] | | |
| color = no | no color | no color |
| | | |
+--------------------+--------------------+--------------------+
(if --color is specified, it always clobbers the setting in [ui])
and after this patch:
+--------------------+--------------------+--------------------+
| | not a tty | a tty |
| | --color not set | --color not set |
| | | |
+--------------------+--------------------+--------------------+
| [ui] | | |
| color (not set) | no color | no color |
| | | |
+--------------------+--------------------+--------------------+
| [ui] | | |
| color = auto | no color | color |
| | | |
+--------------------+--------------------+--------------------+
| [ui] | | |
| color = yes | *no color* | color |
| | | |
+--------------------+--------------------+--------------------+
| [ui] | | |
| color = no | no color | no color |
| | | |
+--------------------+--------------------+--------------------+
(if --color is specified, it always clobbers the setting in [ui])
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 02 May 2017 20:01:54 +0200 |
parents | 8e1708947496 |
children | 9a98023ac8db |
line wrap: on
line diff
--- a/mercurial/help/config.txt Mon May 01 16:43:43 2017 +0200 +++ b/mercurial/help/config.txt Tue May 02 20:01:54 2017 +0200 @@ -1884,9 +1884,9 @@ By default, the first bundle advertised by the server is used. ``color`` - When to colorize output. Possible value are Boolean, "always", "auto", - "never", or "debug". (default: "auto"). "auto" will use color - whenever it seems possible. See :hg:`help color` for details. + When to colorize output. Possible value are Boolean ("yes" or "no"), or + "debug". (default: "yes"). "yes" will use color whenever it seems possible. + See :hg:`help color` for details. ``commitsubrepos`` Whether to commit modified subrepositories when committing the