##// END OF EJS Templates
color: add a 'ui.color' option to control color behavior...
Pierre-Yves David -
r31110:7fec3774 default
parent child Browse files
Show More
@@ -187,10 +187,11 b" testedwith = 'ships-with-hg-core'"
187
187
188 def extsetup(ui):
188 def extsetup(ui):
189 # change default color config
189 # change default color config
190 color._enabledbydefault = True
190 for idx, entry in enumerate(commands.globalopts):
191 for idx, entry in enumerate(commands.globalopts):
191 if entry[1] == 'color':
192 if entry[1] == 'color':
192 patch = ('auto', entry[3].replace(' (EXPERIMENTAL)', ''))
193 patch = (entry[3].replace(' (EXPERIMENTAL)', ''),)
193 new = entry[:2] + patch + entry[4:]
194 new = entry[:3] + patch + entry[4:]
194 commands.globalopts[idx] = new
195 commands.globalopts[idx] = new
195 break
196 break
196
197
@@ -43,6 +43,9 b' except ImportError:'
43 curses = None
43 curses = None
44 _terminfo_params = {}
44 _terminfo_params = {}
45
45
46 # allow the extensions to change the default
47 _enabledbydefault = False
48
46 # start and stop parameters for effects
49 # start and stop parameters for effects
47 _effects = {
50 _effects = {
48 'none': 0,
51 'none': 0,
@@ -167,25 +170,29 b' def _terminfosetup(ui, mode):'
167 "ECMA-48 color\n"))
170 "ECMA-48 color\n"))
168 _terminfo_params.clear()
171 _terminfo_params.clear()
169
172
170 def setup(ui, coloropts):
173 def setup(ui):
171 """configure color on a ui
174 """configure color on a ui
172
175
173 The 'coloropts' argument is the value of the '--color' command line
176 That function both set the colormode for the ui object and read
174 argument. That function both set the colormode for the ui object and read
175 the configuration looking for custom colors and effect definitions."""
177 the configuration looking for custom colors and effect definitions."""
176 mode = _modesetup(ui, coloropts)
178 mode = _modesetup(ui)
177 ui._colormode = mode
179 ui._colormode = mode
178 if mode and mode != 'debug':
180 if mode and mode != 'debug':
179 configstyles(ui)
181 configstyles(ui)
180
182
181 def _modesetup(ui, coloropt):
183 def _modesetup(ui):
182 if ui.plain():
184 if ui.plain():
183 return None
185 return None
184 if coloropt == 'debug':
186 default = 'never'
187 if _enabledbydefault:
188 default = 'auto'
189 # experimental config: ui.color
190 config = ui.config('ui', 'color', default)
191 if config == 'debug':
185 return 'debug'
192 return 'debug'
186
193
187 auto = (coloropt == 'auto')
194 auto = (config == 'auto')
188 always = not auto and util.parsebool(coloropt)
195 always = not auto and util.parsebool(config)
189 if not always and not auto:
196 if not always and not auto:
190 return None
197 return None
191
198
@@ -77,7 +77,7 b' globalopts = ['
77 _('do not prompt, automatically pick the first choice for all prompts')),
77 _('do not prompt, automatically pick the first choice for all prompts')),
78 ('q', 'quiet', None, _('suppress output')),
78 ('q', 'quiet', None, _('suppress output')),
79 ('v', 'verbose', None, _('enable additional output')),
79 ('v', 'verbose', None, _('enable additional output')),
80 ('', 'color', 'never',
80 ('', 'color', '',
81 # i18n: 'always', 'auto', 'never', and 'debug' are keywords
81 # i18n: 'always', 'auto', 'never', and 'debug' are keywords
82 # and should not be translated
82 # and should not be translated
83 _("when to colorize (boolean, always, auto, never, or debug)"
83 _("when to colorize (boolean, always, auto, never, or debug)"
@@ -765,8 +765,11 b' def _dispatch(req):'
765 ui_.insecureconnections = True
765 ui_.insecureconnections = True
766
766
767 # setup color handling
767 # setup color handling
768 coloropt = options['color']
768 for ui_ in uis:
769 for ui_ in uis:
769 color.setup(ui_, options['color'])
770 if coloropt:
771 ui_.setconfig('ui', 'color', coloropt, '--color')
772 color.setup(ui_)
770
773
771 if options['version']:
774 if options['version']:
772 return commands.version_(ui)
775 return commands.version_(ui)
@@ -1,10 +1,10 b''
1 Setup
1 Setup
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [ui]
5 > color = always
4 > [color]
6 > [color]
5 > mode = ansi
7 > mode = ansi
6 > [extensions]
7 > color =
8 > EOF
8 > EOF
9 $ hg init repo
9 $ hg init repo
10 $ cd repo
10 $ cd repo
@@ -35,7 +35,7 b' Setup'
35
35
36 default context
36 default context
37
37
38 $ hg diff --nodates --color=always
38 $ hg diff --nodates
39 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
39 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
40 \x1b[0;31;1m--- a/a\x1b[0m (esc)
40 \x1b[0;31;1m--- a/a\x1b[0m (esc)
41 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
41 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
@@ -51,7 +51,7 b' default context'
51
51
52 --unified=2
52 --unified=2
53
53
54 $ hg diff --nodates -U 2 --color=always
54 $ hg diff --nodates -U 2
55 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
55 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
56 \x1b[0;31;1m--- a/a\x1b[0m (esc)
56 \x1b[0;31;1m--- a/a\x1b[0m (esc)
57 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
57 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
@@ -65,10 +65,11 b' default context'
65
65
66 diffstat
66 diffstat
67
67
68 $ hg diff --stat --color=always
68 $ hg diff --stat
69 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
69 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
70 1 files changed, 1 insertions(+), 1 deletions(-)
70 1 files changed, 1 insertions(+), 1 deletions(-)
71 $ cat <<EOF >> $HGRCPATH
71 $ cat <<EOF >> $HGRCPATH
72 > [extensions]
72 > record =
73 > record =
73 > [ui]
74 > [ui]
74 > interactive = true
75 > interactive = true
@@ -81,7 +82,7 b' diffstat'
81 record
82 record
82
83
83 $ chmod +x a
84 $ chmod +x a
84 $ hg record --color=always -m moda a <<EOF
85 $ hg record -m moda a <<EOF
85 > y
86 > y
86 > y
87 > y
87 > EOF
88 > EOF
@@ -111,7 +112,7 b' record'
111
112
112 qrecord
113 qrecord
113
114
114 $ hg qrecord --color=always -m moda patch <<EOF
115 $ hg qrecord -m moda patch <<EOF
115 > y
116 > y
116 > y
117 > y
117 > EOF
118 > EOF
@@ -151,7 +152,7 b' issue3712: test colorization of subrepo '
151 $ echo aa >> a
152 $ echo aa >> a
152 $ echo bb >> sub/b
153 $ echo bb >> sub/b
153
154
154 $ hg diff --color=always -S
155 $ hg diff -S
155 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
156 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
156 \x1b[0;31;1m--- a/a\x1b[0m (esc)
157 \x1b[0;31;1m--- a/a\x1b[0m (esc)
157 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
158 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
@@ -176,7 +177,7 b' test tabs'
176 > mid tab
177 > mid tab
177 > all tabs
178 > all tabs
178 > EOF
179 > EOF
179 $ hg diff --nodates --color=always
180 $ hg diff --nodates
180 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
181 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
181 \x1b[0;31;1m--- a/a\x1b[0m (esc)
182 \x1b[0;31;1m--- a/a\x1b[0m (esc)
182 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
183 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
@@ -192,7 +193,7 b' test tabs'
192 \x1b[0;32m+\x1b[0m \x1b[0;32mall\x1b[0m \x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
193 \x1b[0;32m+\x1b[0m \x1b[0;32mall\x1b[0m \x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
193 $ echo "[color]" >> $HGRCPATH
194 $ echo "[color]" >> $HGRCPATH
194 $ echo "diff.tab = bold magenta" >> $HGRCPATH
195 $ echo "diff.tab = bold magenta" >> $HGRCPATH
195 $ hg diff --nodates --color=always
196 $ hg diff --nodates
196 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
197 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
197 \x1b[0;31;1m--- a/a\x1b[0m (esc)
198 \x1b[0;31;1m--- a/a\x1b[0m (esc)
198 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
199 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
@@ -533,7 +533,7 b' hide outer repo'
533 -q --quiet suppress output
533 -q --quiet suppress output
534 -v --verbose enable additional output
534 -v --verbose enable additional output
535 --color TYPE when to colorize (boolean, always, auto, never, or
535 --color TYPE when to colorize (boolean, always, auto, never, or
536 debug) (EXPERIMENTAL) (default: never)
536 debug) (EXPERIMENTAL)
537 --config CONFIG [+] set/override config option (use 'section.name=value')
537 --config CONFIG [+] set/override config option (use 'section.name=value')
538 --debug enable debugging output
538 --debug enable debugging output
539 --debugger start debugger
539 --debugger start debugger
@@ -572,7 +572,7 b' hide outer repo'
572 -q --quiet suppress output
572 -q --quiet suppress output
573 -v --verbose enable additional output
573 -v --verbose enable additional output
574 --color TYPE when to colorize (boolean, always, auto, never, or
574 --color TYPE when to colorize (boolean, always, auto, never, or
575 debug) (EXPERIMENTAL) (default: never)
575 debug) (EXPERIMENTAL)
576 --config CONFIG [+] set/override config option (use 'section.name=value')
576 --config CONFIG [+] set/override config option (use 'section.name=value')
577 --debug enable debugging output
577 --debug enable debugging output
578 --debugger start debugger
578 --debugger start debugger
@@ -854,7 +854,7 b' extension help itself'
854 -q --quiet suppress output
854 -q --quiet suppress output
855 -v --verbose enable additional output
855 -v --verbose enable additional output
856 --color TYPE when to colorize (boolean, always, auto, never, or
856 --color TYPE when to colorize (boolean, always, auto, never, or
857 debug) (EXPERIMENTAL) (default: never)
857 debug) (EXPERIMENTAL)
858 --config CONFIG [+] set/override config option (use 'section.name=value')
858 --config CONFIG [+] set/override config option (use 'section.name=value')
859 --debug enable debugging output
859 --debug enable debugging output
860 --debugger start debugger
860 --debugger start debugger
@@ -891,7 +891,7 b" Make sure that single '-v' option shows "
891 -q --quiet suppress output
891 -q --quiet suppress output
892 -v --verbose enable additional output
892 -v --verbose enable additional output
893 --color TYPE when to colorize (boolean, always, auto, never, or
893 --color TYPE when to colorize (boolean, always, auto, never, or
894 debug) (EXPERIMENTAL) (default: never)
894 debug) (EXPERIMENTAL)
895 --config CONFIG [+] set/override config option (use 'section.name=value')
895 --config CONFIG [+] set/override config option (use 'section.name=value')
896 --debug enable debugging output
896 --debug enable debugging output
897 --debugger start debugger
897 --debugger start debugger
@@ -966,7 +966,7 b" help options '-v' and '-v -e' should be "
966 -q --quiet suppress output
966 -q --quiet suppress output
967 -v --verbose enable additional output
967 -v --verbose enable additional output
968 --color TYPE when to colorize (boolean, always, auto, never, or
968 --color TYPE when to colorize (boolean, always, auto, never, or
969 debug) (EXPERIMENTAL) (default: never)
969 debug) (EXPERIMENTAL)
970 --config CONFIG [+] set/override config option (use 'section.name=value')
970 --config CONFIG [+] set/override config option (use 'section.name=value')
971 --debug enable debugging output
971 --debug enable debugging output
972 --debugger start debugger
972 --debugger start debugger
@@ -1002,7 +1002,7 b" help options '-v' and '-v -e' should be "
1002 -q --quiet suppress output
1002 -q --quiet suppress output
1003 -v --verbose enable additional output
1003 -v --verbose enable additional output
1004 --color TYPE when to colorize (boolean, always, auto, never, or
1004 --color TYPE when to colorize (boolean, always, auto, never, or
1005 debug) (EXPERIMENTAL) (default: never)
1005 debug) (EXPERIMENTAL)
1006 --config CONFIG [+] set/override config option (use 'section.name=value')
1006 --config CONFIG [+] set/override config option (use 'section.name=value')
1007 --debug enable debugging output
1007 --debug enable debugging output
1008 --debugger start debugger
1008 --debugger start debugger
@@ -317,7 +317,7 b' Test short command list with verbose opt'
317 -q --quiet suppress output
317 -q --quiet suppress output
318 -v --verbose enable additional output
318 -v --verbose enable additional output
319 --color TYPE when to colorize (boolean, always, auto, never, or
319 --color TYPE when to colorize (boolean, always, auto, never, or
320 debug) (EXPERIMENTAL) (default: never)
320 debug) (EXPERIMENTAL)
321 --config CONFIG [+] set/override config option (use 'section.name=value')
321 --config CONFIG [+] set/override config option (use 'section.name=value')
322 --debug enable debugging output
322 --debug enable debugging output
323 --debugger start debugger
323 --debugger start debugger
@@ -417,7 +417,7 b' Verbose help for add'
417 -q --quiet suppress output
417 -q --quiet suppress output
418 -v --verbose enable additional output
418 -v --verbose enable additional output
419 --color TYPE when to colorize (boolean, always, auto, never, or
419 --color TYPE when to colorize (boolean, always, auto, never, or
420 debug) (EXPERIMENTAL) (default: never)
420 debug) (EXPERIMENTAL)
421 --config CONFIG [+] set/override config option (use 'section.name=value')
421 --config CONFIG [+] set/override config option (use 'section.name=value')
422 --debug enable debugging output
422 --debug enable debugging output
423 --debugger start debugger
423 --debugger start debugger
@@ -2521,7 +2521,7 b' Dish up an empty repo; serve it cold.'
2521 <td>enable additional output</td></tr>
2521 <td>enable additional output</td></tr>
2522 <tr><td></td>
2522 <tr><td></td>
2523 <td>--color TYPE</td>
2523 <td>--color TYPE</td>
2524 <td>when to colorize (boolean, always, auto, never, or debug) (EXPERIMENTAL) (default: never)</td></tr>
2524 <td>when to colorize (boolean, always, auto, never, or debug) (EXPERIMENTAL)</td></tr>
2525 <tr><td></td>
2525 <tr><td></td>
2526 <td>--config CONFIG [+]</td>
2526 <td>--config CONFIG [+]</td>
2527 <td>set/override config option (use 'section.name=value')</td></tr>
2527 <td>set/override config option (use 'section.name=value')</td></tr>
@@ -2722,7 +2722,7 b' Dish up an empty repo; serve it cold.'
2722 <td>enable additional output</td></tr>
2722 <td>enable additional output</td></tr>
2723 <tr><td></td>
2723 <tr><td></td>
2724 <td>--color TYPE</td>
2724 <td>--color TYPE</td>
2725 <td>when to colorize (boolean, always, auto, never, or debug) (EXPERIMENTAL) (default: never)</td></tr>
2725 <td>when to colorize (boolean, always, auto, never, or debug) (EXPERIMENTAL)</td></tr>
2726 <tr><td></td>
2726 <tr><td></td>
2727 <td>--config CONFIG [+]</td>
2727 <td>--config CONFIG [+]</td>
2728 <td>set/override config option (use 'section.name=value')</td></tr>
2728 <td>set/override config option (use 'section.name=value')</td></tr>
@@ -1,6 +1,6 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [ui]
3 > color =
3 > color = always
4 > [color]
4 > [color]
5 > mode = ansi
5 > mode = ansi
6 > EOF
6 > EOF
@@ -14,7 +14,7 b' Terminfo codes compatibility fix'
14
14
15 hg status in repo root:
15 hg status in repo root:
16
16
17 $ hg status --color=always
17 $ hg status
18 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
18 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
19 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
19 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
20 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
20 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
@@ -41,7 +41,7 b' hg status with template'
41
41
42 hg status . in repo root:
42 hg status . in repo root:
43
43
44 $ hg status --color=always .
44 $ hg status .
45 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
45 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
46 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
46 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
47 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
47 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
@@ -49,17 +49,17 b' hg status . in repo root:'
49 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
49 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
50 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
50 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
51
51
52 $ hg status --color=always --cwd a
52 $ hg status --cwd a
53 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
53 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
54 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
54 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
55 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
55 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
56 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
56 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
57 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
57 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
58 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
58 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
59 $ hg status --color=always --cwd a .
59 $ hg status --cwd a .
60 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
60 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
62 $ hg status --color=always --cwd a ..
62 $ hg status --cwd a ..
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
@@ -67,18 +67,18 b' hg status . in repo root:'
67 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
67 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
68 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
68 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
69
69
70 $ hg status --color=always --cwd b
70 $ hg status --cwd b
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
72 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
72 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
75 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
75 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
77 $ hg status --color=always --cwd b .
77 $ hg status --cwd b .
78 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
78 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
79 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
79 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
81 $ hg status --color=always --cwd b ..
81 $ hg status --cwd b ..
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
@@ -86,43 +86,43 b' hg status . in repo root:'
86 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
86 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
87 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
87 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
88
88
89 $ hg status --color=always --cwd a/1
89 $ hg status --cwd a/1
90 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
90 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
92 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
92 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
93 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
93 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
96 $ hg status --color=always --cwd a/1 .
96 $ hg status --cwd a/1 .
97 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
97 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
98 $ hg status --color=always --cwd a/1 ..
98 $ hg status --cwd a/1 ..
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
100 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
100 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
101
101
102 $ hg status --color=always --cwd b/1
102 $ hg status --cwd b/1
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
104 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
104 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
105 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
105 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
106 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
106 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
109 $ hg status --color=always --cwd b/1 .
109 $ hg status --cwd b/1 .
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
111 $ hg status --color=always --cwd b/1 ..
111 $ hg status --cwd b/1 ..
112 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
112 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
113 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
113 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
114 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
114 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
115
115
116 $ hg status --color=always --cwd b/2
116 $ hg status --cwd b/2
117 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
117 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
118 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
118 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
119 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
119 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
120 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
120 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
121 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
121 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
122 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
122 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
123 $ hg status --color=always --cwd b/2 .
123 $ hg status --cwd b/2 .
124 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
124 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
125 $ hg status --color=always --cwd b/2 ..
125 $ hg status --cwd b/2 ..
126 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
126 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
127 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
127 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
128 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
128 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
@@ -137,7 +137,7 b' Make sure --color=never works'
137 ? in_root
137 ? in_root
138
138
139 Make sure ui.formatted=False works
139 Make sure ui.formatted=False works
140 $ hg status --config ui.formatted=False
140 $ hg status --color=auto --config ui.formatted=False
141 ? a/1/in_a_1
141 ? a/1/in_a_1
142 ? a/in_a
142 ? a/in_a
143 ? b/1/in_b_1
143 ? b/1/in_b_1
@@ -179,7 +179,7 b' templates should be.'
179
179
180 hg status:
180 hg status:
181
181
182 $ hg status --color=always
182 $ hg status
183 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
183 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
184 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
184 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
185 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
185 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
@@ -187,7 +187,7 b' hg status:'
187
187
188 hg status modified added removed deleted unknown never-existed ignored:
188 hg status modified added removed deleted unknown never-existed ignored:
189
189
190 $ hg status --color=always modified added removed deleted unknown never-existed ignored
190 $ hg status modified added removed deleted unknown never-existed ignored
191 never-existed: * (glob)
191 never-existed: * (glob)
192 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
192 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
193 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
193 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
@@ -198,7 +198,7 b' hg status modified added removed deleted'
198
198
199 hg status -C:
199 hg status -C:
200
200
201 $ hg status --color=always -C
201 $ hg status -C
202 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
202 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
203 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
203 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
204 \x1b[0;0m modified\x1b[0m (esc)
204 \x1b[0;0m modified\x1b[0m (esc)
@@ -208,7 +208,7 b' hg status -C:'
208
208
209 hg status -A:
209 hg status -A:
210
210
211 $ hg status --color=always -A
211 $ hg status -A
212 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
212 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
213 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
213 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
214 \x1b[0;0m modified\x1b[0m (esc)
214 \x1b[0;0m modified\x1b[0m (esc)
@@ -226,7 +226,7 b' hg status -A (with terminfo color):'
226
226
227 $ mkdir "$TESTTMP/terminfo"
227 $ mkdir "$TESTTMP/terminfo"
228 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
228 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
229 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --color=always -A
229 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo -A
230 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
230 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
231 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
231 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
232 \x1b[30m\x1b[30m modified\x1b[30m (esc)
232 \x1b[30m\x1b[30m modified\x1b[30m (esc)
@@ -245,7 +245,7 b' The user can define effects with raw ter'
245 > # We can override what's in the terminfo database, too
245 > # We can override what's in the terminfo database, too
246 > terminfo.bold = \E[2m
246 > terminfo.bold = \E[2m
247 > EOF
247 > EOF
248 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --config color.status.clean=dim --color=always -A
248 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --config color.status.clean=dim -A
249 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m (esc)
249 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m (esc)
250 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m (esc)
250 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m (esc)
251 \x1b[30m\x1b[30m modified\x1b[30m (esc)
251 \x1b[30m\x1b[30m modified\x1b[30m (esc)
@@ -265,11 +265,11 b' The user can define effects with raw ter'
265
265
266 hg status ignoreddir/file:
266 hg status ignoreddir/file:
267
267
268 $ hg status --color=always ignoreddir/file
268 $ hg status ignoreddir/file
269
269
270 hg status -i ignoreddir/file:
270 hg status -i ignoreddir/file:
271
271
272 $ hg status --color=always -i ignoreddir/file
272 $ hg status -i ignoreddir/file
273 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
273 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
274 $ cd ..
274 $ cd ..
275
275
@@ -293,7 +293,7 b" check 'status -q' and some combinations"
293
293
294 test unknown color
294 test unknown color
295
295
296 $ hg --config color.status.modified=periwinkle status --color=always
296 $ hg --config color.status.modified=periwinkle status
297 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
297 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
298 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
298 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
299 M modified
299 M modified
@@ -308,8 +308,8 b' Check if result is the same or different'
308 If result is not as expected, raise error
308 If result is not as expected, raise error
309
309
310 $ assert() {
310 $ assert() {
311 > hg status --color=always $1 > ../a
311 > hg status $1 > ../a
312 > hg status --color=always $2 > ../b
312 > hg status $2 > ../b
313 > if diff ../a ../b > /dev/null; then
313 > if diff ../a ../b > /dev/null; then
314 > out=0
314 > out=0
315 > else
315 > else
@@ -368,7 +368,7 b" test 'resolve -l'"
368
368
369 hg resolve with one unresolved, one resolved:
369 hg resolve with one unresolved, one resolved:
370
370
371 $ hg resolve --color=always -l
371 $ hg resolve -l
372 \x1b[0;31;1mU \x1b[0m\x1b[0;31;1ma\x1b[0m (esc)
372 \x1b[0;31;1mU \x1b[0m\x1b[0;31;1ma\x1b[0m (esc)
373 \x1b[0;32;1mR \x1b[0m\x1b[0;32;1mb\x1b[0m (esc)
373 \x1b[0;32;1mR \x1b[0m\x1b[0;32;1mb\x1b[0m (esc)
374
374
General Comments 0
You need to be logged in to leave comments. Login now