comparison 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
comparison
equal deleted inserted replaced
32101:8e1708947496 32102:9a85ea1daf49
1882 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``. 1882 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
1883 1883
1884 By default, the first bundle advertised by the server is used. 1884 By default, the first bundle advertised by the server is used.
1885 1885
1886 ``color`` 1886 ``color``
1887 When to colorize output. Possible value are Boolean, "always", "auto", 1887 When to colorize output. Possible value are Boolean ("yes" or "no"), or
1888 "never", or "debug". (default: "auto"). "auto" will use color 1888 "debug". (default: "yes"). "yes" will use color whenever it seems possible.
1889 whenever it seems possible. See :hg:`help color` for details. 1889 See :hg:`help color` for details.
1890 1890
1891 ``commitsubrepos`` 1891 ``commitsubrepos``
1892 Whether to commit modified subrepositories when committing the 1892 Whether to commit modified subrepositories when committing the
1893 parent repository. If False and one subrepository has uncommitted 1893 parent repository. If False and one subrepository has uncommitted
1894 changes, abort the commit. 1894 changes, abort the commit.