##// END OF EJS Templates
tests: trivial fixes for Windows
Matt Harbison -
r35206:8feef8ef default
parent child Browse files
Show More
@@ -1,208 +1,209 b''
1 test command parsing and dispatch
1 test command parsing and dispatch
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5
5
6 Redundant options used to crash (issue436):
6 Redundant options used to crash (issue436):
7 $ hg -v log -v
7 $ hg -v log -v
8 $ hg -v log -v x
8 $ hg -v log -v x
9
9
10 $ echo a > a
10 $ echo a > a
11 $ hg ci -Ama
11 $ hg ci -Ama
12 adding a
12 adding a
13
13
14 Missing arg:
14 Missing arg:
15
15
16 $ hg cat
16 $ hg cat
17 hg cat: invalid arguments
17 hg cat: invalid arguments
18 hg cat [OPTION]... FILE...
18 hg cat [OPTION]... FILE...
19
19
20 output the current or given revision of files
20 output the current or given revision of files
21
21
22 options ([+] can be repeated):
22 options ([+] can be repeated):
23
23
24 -o --output FORMAT print output to file with formatted name
24 -o --output FORMAT print output to file with formatted name
25 -r --rev REV print the given revision
25 -r --rev REV print the given revision
26 --decode apply any matching decode filter
26 --decode apply any matching decode filter
27 -I --include PATTERN [+] include names matching the given patterns
27 -I --include PATTERN [+] include names matching the given patterns
28 -X --exclude PATTERN [+] exclude names matching the given patterns
28 -X --exclude PATTERN [+] exclude names matching the given patterns
29
29
30 (use 'hg cat -h' to show more help)
30 (use 'hg cat -h' to show more help)
31 [255]
31 [255]
32
32
33 Missing parameter for early option:
33 Missing parameter for early option:
34
34
35 $ hg log -R 2>&1 | grep 'hg log'
35 $ hg log -R 2>&1 | grep 'hg log'
36 hg log: option -R requires argument
36 hg log: option -R requires argument
37 hg log [OPTION]... [FILE]
37 hg log [OPTION]... [FILE]
38 (use 'hg log -h' to show more help)
38 (use 'hg log -h' to show more help)
39
39
40 $ hg log -R -- 2>&1 | grep 'hg log'
40 $ hg log -R -- 2>&1 | grep 'hg log'
41 hg log: option -R requires argument
41 hg log: option -R requires argument
42 hg log [OPTION]... [FILE]
42 hg log [OPTION]... [FILE]
43 (use 'hg log -h' to show more help)
43 (use 'hg log -h' to show more help)
44
44
45 Parsing of early options should stop at "--":
45 Parsing of early options should stop at "--":
46
46
47 $ hg cat -- --config=hooks.pre-cat=false
47 $ hg cat -- --config=hooks.pre-cat=false
48 --config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b
48 --config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b
49 [1]
49 [1]
50 $ hg cat -- --debugger
50 $ hg cat -- --debugger
51 --debugger: no such file in rev cb9a9f314b8b
51 --debugger: no such file in rev cb9a9f314b8b
52 [1]
52 [1]
53
53
54 Unparsable form of early options:
54 Unparsable form of early options:
55
55
56 $ hg cat --debugg
56 $ hg cat --debugg
57 abort: option --debugger may not be abbreviated!
57 abort: option --debugger may not be abbreviated!
58 [255]
58 [255]
59
59
60 Parsing failure of early options should be detected before executing the
60 Parsing failure of early options should be detected before executing the
61 command:
61 command:
62
62
63 $ hg log -b '--config=hooks.pre-log=false' default
63 $ hg log -b '--config=hooks.pre-log=false' default
64 abort: option --config may not be abbreviated!
64 abort: option --config may not be abbreviated!
65 [255]
65 [255]
66 $ hg log -b -R. default
66 $ hg log -b -R. default
67 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
67 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
68 [255]
68 [255]
69 $ hg log --cwd .. -b --cwd=. default
69 $ hg log --cwd .. -b --cwd=. default
70 abort: option --cwd may not be abbreviated!
70 abort: option --cwd may not be abbreviated!
71 [255]
71 [255]
72
72
73 However, we can't prevent it from loading extensions and configs:
73 However, we can't prevent it from loading extensions and configs:
74
74
75 $ cat <<EOF > bad.py
75 $ cat <<EOF > bad.py
76 > raise Exception('bad')
76 > raise Exception('bad')
77 > EOF
77 > EOF
78 $ hg log -b '--config=extensions.bad=bad.py' default
78 $ hg log -b '--config=extensions.bad=bad.py' default
79 *** failed to import extension bad from bad.py: bad
79 *** failed to import extension bad from bad.py: bad
80 abort: option --config may not be abbreviated!
80 abort: option --config may not be abbreviated!
81 [255]
81 [255]
82
82
83 $ mkdir -p badrepo/.hg
83 $ mkdir -p badrepo/.hg
84 $ echo 'invalid-syntax' > badrepo/.hg/hgrc
84 $ echo 'invalid-syntax' > badrepo/.hg/hgrc
85 $ hg log -b -Rbadrepo default
85 $ hg log -b -Rbadrepo default
86 hg: parse error at badrepo/.hg/hgrc:1: invalid-syntax
86 hg: parse error at badrepo/.hg/hgrc:1: invalid-syntax (glob)
87 [255]
87 [255]
88
88
89 $ hg log -b --cwd=inexistent default
89 $ hg log -b --cwd=inexistent default
90 abort: No such file or directory: 'inexistent'
90 abort: No such file or directory: 'inexistent' (no-windows !)
91 abort: The system cannot find the file specified: 'inexistent' (windows !)
91 [255]
92 [255]
92
93
93 $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback'
94 $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback'
94 Traceback (most recent call last):
95 Traceback (most recent call last):
95 $ hg log -b '--config=profiling.enabled=yes' 2>&1 | grep -i sample
96 $ hg log -b '--config=profiling.enabled=yes' 2>&1 | grep -i sample
96 Sample count: .*|No samples recorded\. (re)
97 Sample count: .*|No samples recorded\. (re)
97
98
98 Early options can't be specified in [aliases] and [defaults] because they are
99 Early options can't be specified in [aliases] and [defaults] because they are
99 applied before the command name is resolved:
100 applied before the command name is resolved:
100
101
101 $ hg log -b '--config=alias.log=log --config=hooks.pre-log=false'
102 $ hg log -b '--config=alias.log=log --config=hooks.pre-log=false'
102 hg log: option -b not recognized
103 hg log: option -b not recognized
103 error in definition for alias 'log': --config may only be given on the command
104 error in definition for alias 'log': --config may only be given on the command
104 line
105 line
105 [255]
106 [255]
106
107
107 $ hg log -b '--config=defaults.log=--config=hooks.pre-log=false'
108 $ hg log -b '--config=defaults.log=--config=hooks.pre-log=false'
108 abort: option --config may not be abbreviated!
109 abort: option --config may not be abbreviated!
109 [255]
110 [255]
110
111
111 Shell aliases bypass any command parsing rules but for the early one:
112 Shell aliases bypass any command parsing rules but for the early one:
112
113
113 $ hg log -b '--config=alias.log=!echo howdy'
114 $ hg log -b '--config=alias.log=!echo howdy'
114 howdy
115 howdy
115
116
116 Early options must come first if HGPLAIN=+strictflags is specified:
117 Early options must come first if HGPLAIN=+strictflags is specified:
117 (BUG: chg cherry-picks early options to pass them as a server command)
118 (BUG: chg cherry-picks early options to pass them as a server command)
118
119
119 #if no-chg
120 #if no-chg
120 $ HGPLAIN=+strictflags hg log -b --config='hooks.pre-log=false' default
121 $ HGPLAIN=+strictflags hg log -b --config='hooks.pre-log=false' default
121 abort: unknown revision '--config=hooks.pre-log=false'!
122 abort: unknown revision '--config=hooks.pre-log=false'!
122 [255]
123 [255]
123 $ HGPLAIN=+strictflags hg log -b -R. default
124 $ HGPLAIN=+strictflags hg log -b -R. default
124 abort: unknown revision '-R.'!
125 abort: unknown revision '-R.'!
125 [255]
126 [255]
126 $ HGPLAIN=+strictflags hg log -b --cwd=. default
127 $ HGPLAIN=+strictflags hg log -b --cwd=. default
127 abort: unknown revision '--cwd=.'!
128 abort: unknown revision '--cwd=.'!
128 [255]
129 [255]
129 #endif
130 #endif
130 $ HGPLAIN=+strictflags hg log -b --debugger default
131 $ HGPLAIN=+strictflags hg log -b --debugger default
131 abort: unknown revision '--debugger'!
132 abort: unknown revision '--debugger'!
132 [255]
133 [255]
133 $ HGPLAIN=+strictflags hg log -b --config='alias.log=!echo pwned' default
134 $ HGPLAIN=+strictflags hg log -b --config='alias.log=!echo pwned' default
134 abort: unknown revision '--config=alias.log=!echo pwned'!
135 abort: unknown revision '--config=alias.log=!echo pwned'!
135 [255]
136 [255]
136
137
137 $ HGPLAIN=+strictflags hg log --config='hooks.pre-log=false' -b default
138 $ HGPLAIN=+strictflags hg log --config='hooks.pre-log=false' -b default
138 abort: option --config may not be abbreviated!
139 abort: option --config may not be abbreviated!
139 [255]
140 [255]
140 $ HGPLAIN=+strictflags hg log -q --cwd=.. -b default
141 $ HGPLAIN=+strictflags hg log -q --cwd=.. -b default
141 abort: option --cwd may not be abbreviated!
142 abort: option --cwd may not be abbreviated!
142 [255]
143 [255]
143 $ HGPLAIN=+strictflags hg log -q -R . -b default
144 $ HGPLAIN=+strictflags hg log -q -R . -b default
144 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
145 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
145 [255]
146 [255]
146
147
147 $ HGPLAIN=+strictflags hg --config='hooks.pre-log=false' log -b default
148 $ HGPLAIN=+strictflags hg --config='hooks.pre-log=false' log -b default
148 abort: pre-log hook exited with status 1
149 abort: pre-log hook exited with status 1
149 [255]
150 [255]
150 $ HGPLAIN=+strictflags hg --cwd .. -q -Ra log -b default
151 $ HGPLAIN=+strictflags hg --cwd .. -q -Ra log -b default
151 0:cb9a9f314b8b
152 0:cb9a9f314b8b
152
153
153 For compatibility reasons, HGPLAIN=+strictflags is not enabled by plain HGPLAIN:
154 For compatibility reasons, HGPLAIN=+strictflags is not enabled by plain HGPLAIN:
154
155
155 $ HGPLAIN= hg log --config='hooks.pre-log=false' -b default
156 $ HGPLAIN= hg log --config='hooks.pre-log=false' -b default
156 abort: pre-log hook exited with status 1
157 abort: pre-log hook exited with status 1
157 [255]
158 [255]
158 $ HGPLAINEXCEPT= hg log --cwd .. -q -Ra -b default
159 $ HGPLAINEXCEPT= hg log --cwd .. -q -Ra -b default
159 0:cb9a9f314b8b
160 0:cb9a9f314b8b
160
161
161 [defaults]
162 [defaults]
162
163
163 $ hg cat a
164 $ hg cat a
164 a
165 a
165 $ cat >> $HGRCPATH <<EOF
166 $ cat >> $HGRCPATH <<EOF
166 > [defaults]
167 > [defaults]
167 > cat = -r null
168 > cat = -r null
168 > EOF
169 > EOF
169 $ hg cat a
170 $ hg cat a
170 a: no such file in rev 000000000000
171 a: no such file in rev 000000000000
171 [1]
172 [1]
172
173
173 $ cd "$TESTTMP"
174 $ cd "$TESTTMP"
174
175
175 OSError "No such file or directory" / "The system cannot find the path
176 OSError "No such file or directory" / "The system cannot find the path
176 specified" should include filename even when it is empty
177 specified" should include filename even when it is empty
177
178
178 $ hg -R a archive ''
179 $ hg -R a archive ''
179 abort: *: '' (glob)
180 abort: *: '' (glob)
180 [255]
181 [255]
181
182
182 #if no-outer-repo
183 #if no-outer-repo
183
184
184 No repo:
185 No repo:
185
186
186 $ hg cat
187 $ hg cat
187 abort: no repository found in '$TESTTMP' (.hg not found)!
188 abort: no repository found in '$TESTTMP' (.hg not found)!
188 [255]
189 [255]
189
190
190 #endif
191 #endif
191
192
192 #if rmcwd
193 #if rmcwd
193
194
194 Current directory removed:
195 Current directory removed:
195
196
196 $ mkdir $TESTTMP/repo1
197 $ mkdir $TESTTMP/repo1
197 $ cd $TESTTMP/repo1
198 $ cd $TESTTMP/repo1
198 $ rm -rf $TESTTMP/repo1
199 $ rm -rf $TESTTMP/repo1
199
200
200 The output could be one of the following and something else:
201 The output could be one of the following and something else:
201 chg: abort: failed to getcwd (errno = *) (glob)
202 chg: abort: failed to getcwd (errno = *) (glob)
202 abort: error getting current working directory: * (glob)
203 abort: error getting current working directory: * (glob)
203 sh: 0: getcwd() failed: No such file or directory
204 sh: 0: getcwd() failed: No such file or directory
204 Since the exact behavior depends on the shell, only check it returns non-zero.
205 Since the exact behavior depends on the shell, only check it returns non-zero.
205 $ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
206 $ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
206 [1]
207 [1]
207
208
208 #endif
209 #endif
@@ -1,405 +1,405 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [ui]
2 > [ui]
3 > color = always
3 > color = always
4 > [color]
4 > [color]
5 > mode = ansi
5 > mode = ansi
6 > EOF
6 > EOF
7 Terminfo codes compatibility fix
7 Terminfo codes compatibility fix
8 $ echo "color.none=0" >> $HGRCPATH
8 $ echo "color.none=0" >> $HGRCPATH
9
9
10 $ hg init repo1
10 $ hg init repo1
11 $ cd repo1
11 $ cd repo1
12 $ mkdir a b a/1 b/1 b/2
12 $ mkdir a b a/1 b/1 b/2
13 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
13 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
14
14
15 hg status in repo root:
15 hg status in repo root:
16
16
17 $ hg status
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)
21 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
21 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
22 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
22 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
23 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
23 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
24
24
25 $ hg status --color=debug
25 $ hg status --color=debug
26 [status.unknown|? ][status.unknown|a/1/in_a_1]
26 [status.unknown|? ][status.unknown|a/1/in_a_1]
27 [status.unknown|? ][status.unknown|a/in_a]
27 [status.unknown|? ][status.unknown|a/in_a]
28 [status.unknown|? ][status.unknown|b/1/in_b_1]
28 [status.unknown|? ][status.unknown|b/1/in_b_1]
29 [status.unknown|? ][status.unknown|b/2/in_b_2]
29 [status.unknown|? ][status.unknown|b/2/in_b_2]
30 [status.unknown|? ][status.unknown|b/in_b]
30 [status.unknown|? ][status.unknown|b/in_b]
31 [status.unknown|? ][status.unknown|in_root]
31 [status.unknown|? ][status.unknown|in_root]
32 HGPLAIN disables color
32 HGPLAIN disables color
33 $ HGPLAIN=1 hg status --color=debug
33 $ HGPLAIN=1 hg status --color=debug
34 ? a/1/in_a_1
34 ? a/1/in_a_1 (glob)
35 ? a/in_a
35 ? a/in_a (glob)
36 ? b/1/in_b_1
36 ? b/1/in_b_1 (glob)
37 ? b/2/in_b_2
37 ? b/2/in_b_2 (glob)
38 ? b/in_b
38 ? b/in_b (glob)
39 ? in_root
39 ? in_root
40 HGPLAINEXCEPT=color does not disable color
40 HGPLAINEXCEPT=color does not disable color
41 $ HGPLAINEXCEPT=color hg status --color=debug
41 $ HGPLAINEXCEPT=color hg status --color=debug
42 [status.unknown|? ][status.unknown|a/1/in_a_1]
42 [status.unknown|? ][status.unknown|a/1/in_a_1] (glob)
43 [status.unknown|? ][status.unknown|a/in_a]
43 [status.unknown|? ][status.unknown|a/in_a] (glob)
44 [status.unknown|? ][status.unknown|b/1/in_b_1]
44 [status.unknown|? ][status.unknown|b/1/in_b_1] (glob)
45 [status.unknown|? ][status.unknown|b/2/in_b_2]
45 [status.unknown|? ][status.unknown|b/2/in_b_2] (glob)
46 [status.unknown|? ][status.unknown|b/in_b]
46 [status.unknown|? ][status.unknown|b/in_b] (glob)
47 [status.unknown|? ][status.unknown|in_root]
47 [status.unknown|? ][status.unknown|in_root]
48
48
49 hg status with template
49 hg status with template
50 $ hg status -T "{label('red', path)}\n" --color=debug
50 $ hg status -T "{label('red', path)}\n" --color=debug
51 [red|a/1/in_a_1]
51 [red|a/1/in_a_1]
52 [red|a/in_a]
52 [red|a/in_a]
53 [red|b/1/in_b_1]
53 [red|b/1/in_b_1]
54 [red|b/2/in_b_2]
54 [red|b/2/in_b_2]
55 [red|b/in_b]
55 [red|b/in_b]
56 [red|in_root]
56 [red|in_root]
57
57
58 hg status . in repo root:
58 hg status . in repo root:
59
59
60 $ hg status .
60 $ hg status .
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
62 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
62 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
66 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
66 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
67
67
68 $ hg status --cwd a
68 $ hg status --cwd a
69 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
69 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
70 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
70 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
72 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
72 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
75 $ hg status --cwd a .
75 $ hg status --cwd a .
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
77 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
77 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
78 $ hg status --cwd a ..
78 $ hg status --cwd a ..
79 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
79 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
81 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
81 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc)
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc)
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
85
85
86 $ hg status --cwd b
86 $ hg status --cwd b
87 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
87 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
88 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
88 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
89 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
89 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
90 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
90 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
92 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
92 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
93 $ hg status --cwd b .
93 $ hg status --cwd b .
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
96 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
96 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
97 $ hg status --cwd b ..
97 $ hg status --cwd b ..
98 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
98 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
100 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
100 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
101 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
101 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
102 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
102 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
104
104
105 $ hg status --cwd a/1
105 $ hg status --cwd a/1
106 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
106 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
109 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
109 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
111 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
111 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
112 $ hg status --cwd a/1 .
112 $ hg status --cwd a/1 .
113 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
113 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
114 $ hg status --cwd a/1 ..
114 $ hg status --cwd a/1 ..
115 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
115 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
116 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
116 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
117
117
118 $ hg status --cwd b/1
118 $ hg status --cwd b/1
119 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
119 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
120 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
120 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
121 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
121 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
122 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
122 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
123 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
123 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
124 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
124 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
125 $ hg status --cwd b/1 .
125 $ hg status --cwd b/1 .
126 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
126 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
127 $ hg status --cwd b/1 ..
127 $ hg status --cwd b/1 ..
128 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
128 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
129 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
129 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
130 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
130 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
131
131
132 $ hg status --cwd b/2
132 $ hg status --cwd b/2
133 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
133 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
134 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
134 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
135 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
135 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
136 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
136 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
137 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
137 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
138 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
138 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
139 $ hg status --cwd b/2 .
139 $ hg status --cwd b/2 .
140 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
140 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
141 $ hg status --cwd b/2 ..
141 $ hg status --cwd b/2 ..
142 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
142 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
143 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
143 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
144 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
144 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
145
145
146 Make sure --color=never works
146 Make sure --color=never works
147 $ hg status --color=never
147 $ hg status --color=never
148 ? a/1/in_a_1
148 ? a/1/in_a_1
149 ? a/in_a
149 ? a/in_a
150 ? b/1/in_b_1
150 ? b/1/in_b_1
151 ? b/2/in_b_2
151 ? b/2/in_b_2
152 ? b/in_b
152 ? b/in_b
153 ? in_root
153 ? in_root
154
154
155 Make sure ui.formatted=False works
155 Make sure ui.formatted=False works
156 $ hg status --color=auto --config ui.formatted=False
156 $ hg status --color=auto --config ui.formatted=False
157 ? a/1/in_a_1
157 ? a/1/in_a_1
158 ? a/in_a
158 ? a/in_a
159 ? b/1/in_b_1
159 ? b/1/in_b_1
160 ? b/2/in_b_2
160 ? b/2/in_b_2
161 ? b/in_b
161 ? b/in_b
162 ? in_root
162 ? in_root
163
163
164 $ cd ..
164 $ cd ..
165
165
166 $ hg init repo2
166 $ hg init repo2
167 $ cd repo2
167 $ cd repo2
168 $ touch modified removed deleted ignored
168 $ touch modified removed deleted ignored
169 $ echo "^ignored$" > .hgignore
169 $ echo "^ignored$" > .hgignore
170 $ hg ci -A -m 'initial checkin'
170 $ hg ci -A -m 'initial checkin'
171 adding .hgignore
171 adding .hgignore
172 adding deleted
172 adding deleted
173 adding modified
173 adding modified
174 adding removed
174 adding removed
175 $ hg log --color=debug
175 $ hg log --color=debug
176 [log.changeset changeset.draft|changeset: 0:389aef86a55e]
176 [log.changeset changeset.draft|changeset: 0:389aef86a55e]
177 [log.tag|tag: tip]
177 [log.tag|tag: tip]
178 [log.user|user: test]
178 [log.user|user: test]
179 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
179 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
180 [log.summary|summary: initial checkin]
180 [log.summary|summary: initial checkin]
181
181
182 $ hg log -Tcompact --color=debug
182 $ hg log -Tcompact --color=debug
183 [log.changeset changeset.draft|0][tip] [log.node|389aef86a55e] [log.date|1970-01-01 00:00 +0000] [log.user|test]
183 [log.changeset changeset.draft|0][tip] [log.node|389aef86a55e] [log.date|1970-01-01 00:00 +0000] [log.user|test]
184 [ui.note log.description|initial checkin]
184 [ui.note log.description|initial checkin]
185
185
186 Labels on empty strings should not be displayed, labels on custom
186 Labels on empty strings should not be displayed, labels on custom
187 templates should be.
187 templates should be.
188
188
189 $ hg log --color=debug -T '{label("my.label",author)}\n{label("skipped.label","")}'
189 $ hg log --color=debug -T '{label("my.label",author)}\n{label("skipped.label","")}'
190 [my.label|test]
190 [my.label|test]
191 $ touch modified added unknown ignored
191 $ touch modified added unknown ignored
192 $ hg add added
192 $ hg add added
193 $ hg remove removed
193 $ hg remove removed
194 $ rm deleted
194 $ rm deleted
195
195
196 hg status:
196 hg status:
197
197
198 $ hg status
198 $ hg status
199 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
199 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
200 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
200 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
201 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
201 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
202 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
202 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
203
203
204 hg status modified added removed deleted unknown never-existed ignored:
204 hg status modified added removed deleted unknown never-existed ignored:
205
205
206 $ hg status modified added removed deleted unknown never-existed ignored
206 $ hg status modified added removed deleted unknown never-existed ignored
207 never-existed: * (glob)
207 never-existed: * (glob)
208 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
208 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
209 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
209 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
210 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
210 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
211 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
211 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
212
212
213 $ hg copy modified copied
213 $ hg copy modified copied
214
214
215 hg status -C:
215 hg status -C:
216
216
217 $ hg status -C
217 $ hg status -C
218 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
218 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
219 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
219 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
220 \x1b[0;0m modified\x1b[0m (esc)
220 \x1b[0;0m modified\x1b[0m (esc)
221 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
221 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
222 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
222 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
223 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
223 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
224
224
225 hg status -A:
225 hg status -A:
226
226
227 $ hg status -A
227 $ hg status -A
228 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
228 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
229 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
229 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
230 \x1b[0;0m modified\x1b[0m (esc)
230 \x1b[0;0m modified\x1b[0m (esc)
231 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
231 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
232 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
232 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
233 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
233 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
234 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
234 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
235 \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
235 \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
236 \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
236 \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
237
237
238
238
239 hg status -A (with terminfo color):
239 hg status -A (with terminfo color):
240
240
241 #if tic
241 #if tic
242
242
243 $ mkdir "$TESTTMP/terminfo"
243 $ mkdir "$TESTTMP/terminfo"
244 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
244 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
245 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo -A
245 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo -A
246 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
246 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
247 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
247 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
248 \x1b[30m\x1b[30m modified\x1b[30m (esc)
248 \x1b[30m\x1b[30m modified\x1b[30m (esc)
249 \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc)
249 \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc)
250 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc)
250 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc)
251 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc)
251 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc)
252 \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc)
252 \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc)
253 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc)
253 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc)
254 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc)
254 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc)
255
255
256 The user can define effects with raw terminfo codes:
256 The user can define effects with raw terminfo codes:
257
257
258 $ cat <<EOF >> $HGRCPATH
258 $ cat <<EOF >> $HGRCPATH
259 > # Completely bogus code for dim
259 > # Completely bogus code for dim
260 > terminfo.dim = \E[88m
260 > terminfo.dim = \E[88m
261 > # We can override what's in the terminfo database, too
261 > # We can override what's in the terminfo database, too
262 > terminfo.bold = \E[2m
262 > terminfo.bold = \E[2m
263 > EOF
263 > EOF
264 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --config color.status.clean=dim -A
264 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --config color.status.clean=dim -A
265 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m (esc)
265 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m (esc)
266 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m (esc)
266 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m (esc)
267 \x1b[30m\x1b[30m modified\x1b[30m (esc)
267 \x1b[30m\x1b[30m modified\x1b[30m (esc)
268 \x1b[30m\x1b[31m\x1b[2mR \x1b[30m\x1b[30m\x1b[31m\x1b[2mremoved\x1b[30m (esc)
268 \x1b[30m\x1b[31m\x1b[2mR \x1b[30m\x1b[30m\x1b[31m\x1b[2mremoved\x1b[30m (esc)
269 \x1b[30m\x1b[36m\x1b[2m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[2m\x1b[4mdeleted\x1b[30m (esc)
269 \x1b[30m\x1b[36m\x1b[2m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[2m\x1b[4mdeleted\x1b[30m (esc)
270 \x1b[30m\x1b[35m\x1b[2m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[2m\x1b[4munknown\x1b[30m (esc)
270 \x1b[30m\x1b[35m\x1b[2m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[2m\x1b[4munknown\x1b[30m (esc)
271 \x1b[30m\x1b[30m\x1b[2mI \x1b[30m\x1b[30m\x1b[30m\x1b[2mignored\x1b[30m (esc)
271 \x1b[30m\x1b[30m\x1b[2mI \x1b[30m\x1b[30m\x1b[30m\x1b[2mignored\x1b[30m (esc)
272 \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88m.hgignore\x1b[30m (esc)
272 \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88m.hgignore\x1b[30m (esc)
273 \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88mmodified\x1b[30m (esc)
273 \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88mmodified\x1b[30m (esc)
274
274
275 #endif
275 #endif
276
276
277
277
278 $ echo "^ignoreddir$" > .hgignore
278 $ echo "^ignoreddir$" > .hgignore
279 $ mkdir ignoreddir
279 $ mkdir ignoreddir
280 $ touch ignoreddir/file
280 $ touch ignoreddir/file
281
281
282 hg status ignoreddir/file:
282 hg status ignoreddir/file:
283
283
284 $ hg status ignoreddir/file
284 $ hg status ignoreddir/file
285
285
286 hg status -i ignoreddir/file:
286 hg status -i ignoreddir/file:
287
287
288 $ hg status -i ignoreddir/file
288 $ hg status -i ignoreddir/file
289 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
289 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
290 $ cd ..
290 $ cd ..
291
291
292 check 'status -q' and some combinations
292 check 'status -q' and some combinations
293
293
294 $ hg init repo3
294 $ hg init repo3
295 $ cd repo3
295 $ cd repo3
296 $ touch modified removed deleted ignored
296 $ touch modified removed deleted ignored
297 $ echo "^ignored$" > .hgignore
297 $ echo "^ignored$" > .hgignore
298 $ hg commit -A -m 'initial checkin'
298 $ hg commit -A -m 'initial checkin'
299 adding .hgignore
299 adding .hgignore
300 adding deleted
300 adding deleted
301 adding modified
301 adding modified
302 adding removed
302 adding removed
303 $ touch added unknown ignored
303 $ touch added unknown ignored
304 $ hg add added
304 $ hg add added
305 $ echo "test" >> modified
305 $ echo "test" >> modified
306 $ hg remove removed
306 $ hg remove removed
307 $ rm deleted
307 $ rm deleted
308 $ hg copy modified copied
308 $ hg copy modified copied
309
309
310 test unknown color
310 test unknown color
311
311
312 $ hg --config color.status.modified=periwinkle status
312 $ hg --config color.status.modified=periwinkle status
313 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
313 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
314 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
314 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
315 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
315 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
316 M modified
316 M modified
317 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
317 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
318 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
318 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
319 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
319 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
320 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
320 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
321 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
321 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
322
322
323 Run status with 2 different flags.
323 Run status with 2 different flags.
324 Check if result is the same or different.
324 Check if result is the same or different.
325 If result is not as expected, raise error
325 If result is not as expected, raise error
326
326
327 $ assert() {
327 $ assert() {
328 > hg status $1 > ../a
328 > hg status $1 > ../a
329 > hg status $2 > ../b
329 > hg status $2 > ../b
330 > if diff ../a ../b > /dev/null; then
330 > if diff ../a ../b > /dev/null; then
331 > out=0
331 > out=0
332 > else
332 > else
333 > out=1
333 > out=1
334 > fi
334 > fi
335 > if [ $3 -eq 0 ]; then
335 > if [ $3 -eq 0 ]; then
336 > df="same"
336 > df="same"
337 > else
337 > else
338 > df="different"
338 > df="different"
339 > fi
339 > fi
340 > if [ $out -ne $3 ]; then
340 > if [ $out -ne $3 ]; then
341 > echo "Error on $1 and $2, should be $df."
341 > echo "Error on $1 and $2, should be $df."
342 > fi
342 > fi
343 > }
343 > }
344
344
345 assert flag1 flag2 [0-same | 1-different]
345 assert flag1 flag2 [0-same | 1-different]
346
346
347 $ assert "-q" "-mard" 0
347 $ assert "-q" "-mard" 0
348 $ assert "-A" "-marduicC" 0
348 $ assert "-A" "-marduicC" 0
349 $ assert "-qA" "-mardcC" 0
349 $ assert "-qA" "-mardcC" 0
350 $ assert "-qAui" "-A" 0
350 $ assert "-qAui" "-A" 0
351 $ assert "-qAu" "-marducC" 0
351 $ assert "-qAu" "-marducC" 0
352 $ assert "-qAi" "-mardicC" 0
352 $ assert "-qAi" "-mardicC" 0
353 $ assert "-qu" "-u" 0
353 $ assert "-qu" "-u" 0
354 $ assert "-q" "-u" 1
354 $ assert "-q" "-u" 1
355 $ assert "-m" "-a" 1
355 $ assert "-m" "-a" 1
356 $ assert "-r" "-d" 1
356 $ assert "-r" "-d" 1
357 $ cd ..
357 $ cd ..
358
358
359 test 'resolve -l'
359 test 'resolve -l'
360
360
361 $ hg init repo4
361 $ hg init repo4
362 $ cd repo4
362 $ cd repo4
363 $ echo "file a" > a
363 $ echo "file a" > a
364 $ echo "file b" > b
364 $ echo "file b" > b
365 $ hg add a b
365 $ hg add a b
366 $ hg commit -m "initial"
366 $ hg commit -m "initial"
367 $ echo "file a change 1" > a
367 $ echo "file a change 1" > a
368 $ echo "file b change 1" > b
368 $ echo "file b change 1" > b
369 $ hg commit -m "head 1"
369 $ hg commit -m "head 1"
370 $ hg update 0
370 $ hg update 0
371 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
371 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 $ echo "file a change 2" > a
372 $ echo "file a change 2" > a
373 $ echo "file b change 2" > b
373 $ echo "file b change 2" > b
374 $ hg commit -m "head 2"
374 $ hg commit -m "head 2"
375 created new head
375 created new head
376 $ hg merge
376 $ hg merge
377 merging a
377 merging a
378 merging b
378 merging b
379 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
379 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
380 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
380 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
381 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
381 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
382 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
382 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
383 [1]
383 [1]
384 $ hg resolve -m b
384 $ hg resolve -m b
385
385
386 hg resolve with one unresolved, one resolved:
386 hg resolve with one unresolved, one resolved:
387
387
388 $ hg resolve -l
388 $ hg resolve -l
389 \x1b[0;31;1mU \x1b[0m\x1b[0;31;1ma\x1b[0m (esc)
389 \x1b[0;31;1mU \x1b[0m\x1b[0;31;1ma\x1b[0m (esc)
390 \x1b[0;32;1mR \x1b[0m\x1b[0;32;1mb\x1b[0m (esc)
390 \x1b[0;32;1mR \x1b[0m\x1b[0;32;1mb\x1b[0m (esc)
391
391
392 color coding of error message with current availability of curses
392 color coding of error message with current availability of curses
393
393
394 $ hg unknowncommand > /dev/null
394 $ hg unknowncommand > /dev/null
395 hg: unknown command 'unknowncommand'
395 hg: unknown command 'unknowncommand'
396 [255]
396 [255]
397
397
398 color coding of error message without curses
398 color coding of error message without curses
399
399
400 $ echo 'raise ImportError' > curses.py
400 $ echo 'raise ImportError' > curses.py
401 $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null
401 $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null
402 hg: unknown command 'unknowncommand'
402 hg: unknown command 'unknowncommand'
403 [255]
403 [255]
404
404
405 $ cd ..
405 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now