Show More
@@ -195,8 +195,9 b' def _modesetup(ui):' | |||
|
195 | 195 | auto = (config == 'auto') |
|
196 | 196 | always = False |
|
197 | 197 | if not auto and util.parsebool(config): |
|
198 |
# |
|
|
199 | if ui.configsource('ui', 'color') == '--color': | |
|
198 | # We want the config to behave like a boolean, "on" is actually auto, | |
|
199 | # but "always" value is treated as a special case to reduce confusion. | |
|
200 | if ui.configsource('ui', 'color') == '--color' or config == 'always': | |
|
200 | 201 | always = True |
|
201 | 202 | else: |
|
202 | 203 | auto = True |
@@ -1885,8 +1885,8 b' User interface controls.' | |||
|
1885 | 1885 | |
|
1886 | 1886 | ``color`` |
|
1887 | 1887 | When to colorize output. Possible value are Boolean ("yes" or "no"), or |
|
1888 |
"debug". (default: "yes"). "yes" will use color whenever it |
|
|
1889 | See :hg:`help color` for details. | |
|
1888 | "debug", or "always". (default: "yes"). "yes" will use color whenever it | |
|
1889 | seems possible. See :hg:`help color` for details. | |
|
1890 | 1890 | |
|
1891 | 1891 | ``commitsubrepos`` |
|
1892 | 1892 | Whether to commit modified subrepositories when committing the |
@@ -2,7 +2,7 b' Setup' | |||
|
2 | 2 | |
|
3 | 3 | $ cat <<EOF >> $HGRCPATH |
|
4 | 4 | > [ui] |
|
5 |
> color = |
|
|
5 | > color = yes | |
|
6 | 6 | > formatted = always |
|
7 | 7 | > [color] |
|
8 | 8 | > mode = ansi |
@@ -82,6 +82,22 b' default context' | |||
|
82 | 82 | a |
|
83 | 83 | c |
|
84 | 84 | |
|
85 | (check that 'ui.color=always' force color) | |
|
86 | ||
|
87 | $ hg diff --nodates --config ui.formatted=no --config ui.color=always | |
|
88 | \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc) | |
|
89 | \x1b[0;31;1m--- a/a\x1b[0m (esc) | |
|
90 | \x1b[0;32;1m+++ b/a\x1b[0m (esc) | |
|
91 | \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc) | |
|
92 | c | |
|
93 | a | |
|
94 | a | |
|
95 | \x1b[0;31m-b\x1b[0m (esc) | |
|
96 | \x1b[0;32m+dd\x1b[0m (esc) | |
|
97 | a | |
|
98 | a | |
|
99 | c | |
|
100 | ||
|
85 | 101 | --unified=2 |
|
86 | 102 | |
|
87 | 103 | $ hg diff --nodates -U 2 |
@@ -160,8 +160,7 b' Pager with color enabled allows colors t' | |||
|
160 | 160 | even though stdout is no longer a tty. |
|
161 | 161 | $ cat >> $HGRCPATH <<EOF |
|
162 | 162 | > [ui] |
|
163 |
> color = y |
|
|
164 | > formatted = yes | |
|
163 | > color = always | |
|
165 | 164 | > [color] |
|
166 | 165 | > mode = ansi |
|
167 | 166 | > EOF |
General Comments 0
You need to be logged in to leave comments.
Login now