##// END OF EJS Templates
color: special case 'always' in 'ui.color'...
Pierre-Yves David -
r32104:9a98023a stable
parent child Browse files
Show More
@@ -195,8 +195,9 b' def _modesetup(ui):'
195 auto = (config == 'auto')
195 auto = (config == 'auto')
196 always = False
196 always = False
197 if not auto and util.parsebool(config):
197 if not auto and util.parsebool(config):
198 # we want the config to behave like a boolean, "on" is actually auto
198 # We want the config to behave like a boolean, "on" is actually auto,
199 if ui.configsource('ui', 'color') == '--color':
199 # but "always" value is treated as a special case to reduce confusion.
200 if ui.configsource('ui', 'color') == '--color' or config == 'always':
200 always = True
201 always = True
201 else:
202 else:
202 auto = True
203 auto = True
@@ -1885,8 +1885,8 b' User interface controls.'
1885
1885
1886 ``color``
1886 ``color``
1887 When to colorize output. Possible value are Boolean ("yes" or "no"), or
1887 When to colorize output. Possible value are Boolean ("yes" or "no"), or
1888 "debug". (default: "yes"). "yes" will use color whenever it seems possible.
1888 "debug", or "always". (default: "yes"). "yes" will use color whenever it
1889 See :hg:`help color` for details.
1889 seems possible. 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
@@ -2,7 +2,7 b' Setup'
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [ui]
4 > [ui]
5 > color = always
5 > color = yes
6 > formatted = always
6 > formatted = always
7 > [color]
7 > [color]
8 > mode = ansi
8 > mode = ansi
@@ -82,6 +82,22 b' default context'
82 a
82 a
83 c
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 --unified=2
101 --unified=2
86
102
87 $ hg diff --nodates -U 2
103 $ hg diff --nodates -U 2
@@ -160,8 +160,7 b' Pager with color enabled allows colors t'
160 even though stdout is no longer a tty.
160 even though stdout is no longer a tty.
161 $ cat >> $HGRCPATH <<EOF
161 $ cat >> $HGRCPATH <<EOF
162 > [ui]
162 > [ui]
163 > color = yes
163 > color = always
164 > formatted = yes
165 > [color]
164 > [color]
166 > mode = ansi
165 > mode = ansi
167 > EOF
166 > EOF
@@ -141,8 +141,7 b' Pager with color enabled allows colors t'
141 even though stdout is no longer a tty.
141 even though stdout is no longer a tty.
142 $ cat >> $HGRCPATH <<EOF
142 $ cat >> $HGRCPATH <<EOF
143 > [ui]
143 > [ui]
144 > color = yes
144 > color = always
145 > formatted = yes
146 > [color]
145 > [color]
147 > mode = ansi
146 > mode = ansi
148 > EOF
147 > EOF
@@ -1,7 +1,6 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [ui]
2 > [ui]
3 > color = always
3 > color = always
4 > formatted = yes
5 > [color]
4 > [color]
6 > mode = ansi
5 > mode = ansi
7 > EOF
6 > EOF
General Comments 0
You need to be logged in to leave comments. Login now