##// END OF EJS Templates
status: add test that shows that the Rust implementation has a bug...
Raphaël Gomès -
r47217:40c8ae49 stable
parent child Browse files
Show More
@@ -1,682 +1,694 b''
1 $ hg init repo1
1 $ hg init repo1
2 $ cd repo1
2 $ cd repo1
3 $ mkdir a b a/1 b/1 b/2
3 $ mkdir a b a/1 b/1 b/2
4 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
4 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
5
5
6 hg status in repo root:
6 hg status in repo root:
7
7
8 $ hg status
8 $ hg status
9 ? a/1/in_a_1
9 ? a/1/in_a_1
10 ? a/in_a
10 ? a/in_a
11 ? b/1/in_b_1
11 ? b/1/in_b_1
12 ? b/2/in_b_2
12 ? b/2/in_b_2
13 ? b/in_b
13 ? b/in_b
14 ? in_root
14 ? in_root
15
15
16 hg status . in repo root:
16 hg status . in repo root:
17
17
18 $ hg status .
18 $ hg status .
19 ? a/1/in_a_1
19 ? a/1/in_a_1
20 ? a/in_a
20 ? a/in_a
21 ? b/1/in_b_1
21 ? b/1/in_b_1
22 ? b/2/in_b_2
22 ? b/2/in_b_2
23 ? b/in_b
23 ? b/in_b
24 ? in_root
24 ? in_root
25
25
26 $ hg status --cwd a
26 $ hg status --cwd a
27 ? a/1/in_a_1
27 ? a/1/in_a_1
28 ? a/in_a
28 ? a/in_a
29 ? b/1/in_b_1
29 ? b/1/in_b_1
30 ? b/2/in_b_2
30 ? b/2/in_b_2
31 ? b/in_b
31 ? b/in_b
32 ? in_root
32 ? in_root
33 $ hg status --cwd a .
33 $ hg status --cwd a .
34 ? 1/in_a_1
34 ? 1/in_a_1
35 ? in_a
35 ? in_a
36 $ hg status --cwd a ..
36 $ hg status --cwd a ..
37 ? 1/in_a_1
37 ? 1/in_a_1
38 ? in_a
38 ? in_a
39 ? ../b/1/in_b_1
39 ? ../b/1/in_b_1
40 ? ../b/2/in_b_2
40 ? ../b/2/in_b_2
41 ? ../b/in_b
41 ? ../b/in_b
42 ? ../in_root
42 ? ../in_root
43
43
44 $ hg status --cwd b
44 $ hg status --cwd b
45 ? a/1/in_a_1
45 ? a/1/in_a_1
46 ? a/in_a
46 ? a/in_a
47 ? b/1/in_b_1
47 ? b/1/in_b_1
48 ? b/2/in_b_2
48 ? b/2/in_b_2
49 ? b/in_b
49 ? b/in_b
50 ? in_root
50 ? in_root
51 $ hg status --cwd b .
51 $ hg status --cwd b .
52 ? 1/in_b_1
52 ? 1/in_b_1
53 ? 2/in_b_2
53 ? 2/in_b_2
54 ? in_b
54 ? in_b
55 $ hg status --cwd b ..
55 $ hg status --cwd b ..
56 ? ../a/1/in_a_1
56 ? ../a/1/in_a_1
57 ? ../a/in_a
57 ? ../a/in_a
58 ? 1/in_b_1
58 ? 1/in_b_1
59 ? 2/in_b_2
59 ? 2/in_b_2
60 ? in_b
60 ? in_b
61 ? ../in_root
61 ? ../in_root
62
62
63 $ hg status --cwd a/1
63 $ hg status --cwd a/1
64 ? a/1/in_a_1
64 ? a/1/in_a_1
65 ? a/in_a
65 ? a/in_a
66 ? b/1/in_b_1
66 ? b/1/in_b_1
67 ? b/2/in_b_2
67 ? b/2/in_b_2
68 ? b/in_b
68 ? b/in_b
69 ? in_root
69 ? in_root
70 $ hg status --cwd a/1 .
70 $ hg status --cwd a/1 .
71 ? in_a_1
71 ? in_a_1
72 $ hg status --cwd a/1 ..
72 $ hg status --cwd a/1 ..
73 ? in_a_1
73 ? in_a_1
74 ? ../in_a
74 ? ../in_a
75
75
76 $ hg status --cwd b/1
76 $ hg status --cwd b/1
77 ? a/1/in_a_1
77 ? a/1/in_a_1
78 ? a/in_a
78 ? a/in_a
79 ? b/1/in_b_1
79 ? b/1/in_b_1
80 ? b/2/in_b_2
80 ? b/2/in_b_2
81 ? b/in_b
81 ? b/in_b
82 ? in_root
82 ? in_root
83 $ hg status --cwd b/1 .
83 $ hg status --cwd b/1 .
84 ? in_b_1
84 ? in_b_1
85 $ hg status --cwd b/1 ..
85 $ hg status --cwd b/1 ..
86 ? in_b_1
86 ? in_b_1
87 ? ../2/in_b_2
87 ? ../2/in_b_2
88 ? ../in_b
88 ? ../in_b
89
89
90 $ hg status --cwd b/2
90 $ hg status --cwd b/2
91 ? a/1/in_a_1
91 ? a/1/in_a_1
92 ? a/in_a
92 ? a/in_a
93 ? b/1/in_b_1
93 ? b/1/in_b_1
94 ? b/2/in_b_2
94 ? b/2/in_b_2
95 ? b/in_b
95 ? b/in_b
96 ? in_root
96 ? in_root
97 $ hg status --cwd b/2 .
97 $ hg status --cwd b/2 .
98 ? in_b_2
98 ? in_b_2
99 $ hg status --cwd b/2 ..
99 $ hg status --cwd b/2 ..
100 ? ../1/in_b_1
100 ? ../1/in_b_1
101 ? in_b_2
101 ? in_b_2
102 ? ../in_b
102 ? ../in_b
103
103
104 combining patterns with root and patterns without a root works
104 combining patterns with root and patterns without a root works
105
105
106 $ hg st a/in_a re:.*b$
106 $ hg st a/in_a re:.*b$
107 ? a/in_a
107 ? a/in_a
108 ? b/in_b
108 ? b/in_b
109
109
110 tweaking defaults works
110 tweaking defaults works
111 $ hg status --cwd a --config ui.tweakdefaults=yes
111 $ hg status --cwd a --config ui.tweakdefaults=yes
112 ? 1/in_a_1
112 ? 1/in_a_1
113 ? in_a
113 ? in_a
114 ? ../b/1/in_b_1
114 ? ../b/1/in_b_1
115 ? ../b/2/in_b_2
115 ? ../b/2/in_b_2
116 ? ../b/in_b
116 ? ../b/in_b
117 ? ../in_root
117 ? ../in_root
118 $ HGPLAIN=1 hg status --cwd a --config ui.tweakdefaults=yes
118 $ HGPLAIN=1 hg status --cwd a --config ui.tweakdefaults=yes
119 ? a/1/in_a_1 (glob)
119 ? a/1/in_a_1 (glob)
120 ? a/in_a (glob)
120 ? a/in_a (glob)
121 ? b/1/in_b_1 (glob)
121 ? b/1/in_b_1 (glob)
122 ? b/2/in_b_2 (glob)
122 ? b/2/in_b_2 (glob)
123 ? b/in_b (glob)
123 ? b/in_b (glob)
124 ? in_root
124 ? in_root
125 $ HGPLAINEXCEPT=tweakdefaults hg status --cwd a --config ui.tweakdefaults=yes
125 $ HGPLAINEXCEPT=tweakdefaults hg status --cwd a --config ui.tweakdefaults=yes
126 ? 1/in_a_1
126 ? 1/in_a_1
127 ? in_a
127 ? in_a
128 ? ../b/1/in_b_1
128 ? ../b/1/in_b_1
129 ? ../b/2/in_b_2
129 ? ../b/2/in_b_2
130 ? ../b/in_b
130 ? ../b/in_b
131 ? ../in_root (glob)
131 ? ../in_root (glob)
132
132
133 relative paths can be requested
133 relative paths can be requested
134
134
135 $ hg status --cwd a --config ui.relative-paths=yes
135 $ hg status --cwd a --config ui.relative-paths=yes
136 ? 1/in_a_1
136 ? 1/in_a_1
137 ? in_a
137 ? in_a
138 ? ../b/1/in_b_1
138 ? ../b/1/in_b_1
139 ? ../b/2/in_b_2
139 ? ../b/2/in_b_2
140 ? ../b/in_b
140 ? ../b/in_b
141 ? ../in_root
141 ? ../in_root
142
142
143 $ hg status --cwd a . --config ui.relative-paths=legacy
143 $ hg status --cwd a . --config ui.relative-paths=legacy
144 ? 1/in_a_1
144 ? 1/in_a_1
145 ? in_a
145 ? in_a
146 $ hg status --cwd a . --config ui.relative-paths=no
146 $ hg status --cwd a . --config ui.relative-paths=no
147 ? a/1/in_a_1
147 ? a/1/in_a_1
148 ? a/in_a
148 ? a/in_a
149
149
150 commands.status.relative overrides ui.relative-paths
150 commands.status.relative overrides ui.relative-paths
151
151
152 $ cat >> $HGRCPATH <<EOF
152 $ cat >> $HGRCPATH <<EOF
153 > [ui]
153 > [ui]
154 > relative-paths = False
154 > relative-paths = False
155 > [commands]
155 > [commands]
156 > status.relative = True
156 > status.relative = True
157 > EOF
157 > EOF
158 $ hg status --cwd a
158 $ hg status --cwd a
159 ? 1/in_a_1
159 ? 1/in_a_1
160 ? in_a
160 ? in_a
161 ? ../b/1/in_b_1
161 ? ../b/1/in_b_1
162 ? ../b/2/in_b_2
162 ? ../b/2/in_b_2
163 ? ../b/in_b
163 ? ../b/in_b
164 ? ../in_root
164 ? ../in_root
165 $ HGPLAIN=1 hg status --cwd a
165 $ HGPLAIN=1 hg status --cwd a
166 ? a/1/in_a_1 (glob)
166 ? a/1/in_a_1 (glob)
167 ? a/in_a (glob)
167 ? a/in_a (glob)
168 ? b/1/in_b_1 (glob)
168 ? b/1/in_b_1 (glob)
169 ? b/2/in_b_2 (glob)
169 ? b/2/in_b_2 (glob)
170 ? b/in_b (glob)
170 ? b/in_b (glob)
171 ? in_root
171 ? in_root
172
172
173 if relative paths are explicitly off, tweakdefaults doesn't change it
173 if relative paths are explicitly off, tweakdefaults doesn't change it
174 $ cat >> $HGRCPATH <<EOF
174 $ cat >> $HGRCPATH <<EOF
175 > [commands]
175 > [commands]
176 > status.relative = False
176 > status.relative = False
177 > EOF
177 > EOF
178 $ hg status --cwd a --config ui.tweakdefaults=yes
178 $ hg status --cwd a --config ui.tweakdefaults=yes
179 ? a/1/in_a_1
179 ? a/1/in_a_1
180 ? a/in_a
180 ? a/in_a
181 ? b/1/in_b_1
181 ? b/1/in_b_1
182 ? b/2/in_b_2
182 ? b/2/in_b_2
183 ? b/in_b
183 ? b/in_b
184 ? in_root
184 ? in_root
185
185
186 $ cd ..
186 $ cd ..
187
187
188 $ hg init repo2
188 $ hg init repo2
189 $ cd repo2
189 $ cd repo2
190 $ touch modified removed deleted ignored
190 $ touch modified removed deleted ignored
191 $ echo "^ignored$" > .hgignore
191 $ echo "^ignored$" > .hgignore
192 $ hg ci -A -m 'initial checkin'
192 $ hg ci -A -m 'initial checkin'
193 adding .hgignore
193 adding .hgignore
194 adding deleted
194 adding deleted
195 adding modified
195 adding modified
196 adding removed
196 adding removed
197 $ touch modified added unknown ignored
197 $ touch modified added unknown ignored
198 $ hg add added
198 $ hg add added
199 $ hg remove removed
199 $ hg remove removed
200 $ rm deleted
200 $ rm deleted
201
201
202 hg status:
202 hg status:
203
203
204 $ hg status
204 $ hg status
205 A added
205 A added
206 R removed
206 R removed
207 ! deleted
207 ! deleted
208 ? unknown
208 ? unknown
209
209
210 hg status modified added removed deleted unknown never-existed ignored:
210 hg status modified added removed deleted unknown never-existed ignored:
211
211
212 $ hg status modified added removed deleted unknown never-existed ignored
212 $ hg status modified added removed deleted unknown never-existed ignored
213 never-existed: * (glob)
213 never-existed: * (glob)
214 A added
214 A added
215 R removed
215 R removed
216 ! deleted
216 ! deleted
217 ? unknown
217 ? unknown
218
218
219 $ hg copy modified copied
219 $ hg copy modified copied
220
220
221 hg status -C:
221 hg status -C:
222
222
223 $ hg status -C
223 $ hg status -C
224 A added
224 A added
225 A copied
225 A copied
226 modified
226 modified
227 R removed
227 R removed
228 ! deleted
228 ! deleted
229 ? unknown
229 ? unknown
230
230
231 hg status -A:
231 hg status -A:
232
232
233 $ hg status -A
233 $ hg status -A
234 A added
234 A added
235 A copied
235 A copied
236 modified
236 modified
237 R removed
237 R removed
238 ! deleted
238 ! deleted
239 ? unknown
239 ? unknown
240 I ignored
240 I ignored
241 C .hgignore
241 C .hgignore
242 C modified
242 C modified
243
243
244 $ hg status -A -T '{status} {path} {node|shortest}\n'
244 $ hg status -A -T '{status} {path} {node|shortest}\n'
245 A added ffff
245 A added ffff
246 A copied ffff
246 A copied ffff
247 R removed ffff
247 R removed ffff
248 ! deleted ffff
248 ! deleted ffff
249 ? unknown ffff
249 ? unknown ffff
250 I ignored ffff
250 I ignored ffff
251 C .hgignore ffff
251 C .hgignore ffff
252 C modified ffff
252 C modified ffff
253
253
254 $ hg status -A -Tjson
254 $ hg status -A -Tjson
255 [
255 [
256 {
256 {
257 "itemtype": "file",
257 "itemtype": "file",
258 "path": "added",
258 "path": "added",
259 "status": "A"
259 "status": "A"
260 },
260 },
261 {
261 {
262 "itemtype": "file",
262 "itemtype": "file",
263 "path": "copied",
263 "path": "copied",
264 "source": "modified",
264 "source": "modified",
265 "status": "A"
265 "status": "A"
266 },
266 },
267 {
267 {
268 "itemtype": "file",
268 "itemtype": "file",
269 "path": "removed",
269 "path": "removed",
270 "status": "R"
270 "status": "R"
271 },
271 },
272 {
272 {
273 "itemtype": "file",
273 "itemtype": "file",
274 "path": "deleted",
274 "path": "deleted",
275 "status": "!"
275 "status": "!"
276 },
276 },
277 {
277 {
278 "itemtype": "file",
278 "itemtype": "file",
279 "path": "unknown",
279 "path": "unknown",
280 "status": "?"
280 "status": "?"
281 },
281 },
282 {
282 {
283 "itemtype": "file",
283 "itemtype": "file",
284 "path": "ignored",
284 "path": "ignored",
285 "status": "I"
285 "status": "I"
286 },
286 },
287 {
287 {
288 "itemtype": "file",
288 "itemtype": "file",
289 "path": ".hgignore",
289 "path": ".hgignore",
290 "status": "C"
290 "status": "C"
291 },
291 },
292 {
292 {
293 "itemtype": "file",
293 "itemtype": "file",
294 "path": "modified",
294 "path": "modified",
295 "status": "C"
295 "status": "C"
296 }
296 }
297 ]
297 ]
298
298
299 $ hg status -A -Tpickle > pickle
299 $ hg status -A -Tpickle > pickle
300 >>> from __future__ import print_function
300 >>> from __future__ import print_function
301 >>> from mercurial import util
301 >>> from mercurial import util
302 >>> pickle = util.pickle
302 >>> pickle = util.pickle
303 >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb")))
303 >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb")))
304 >>> for s, p in data: print("%s %s" % (s, p))
304 >>> for s, p in data: print("%s %s" % (s, p))
305 ! deleted
305 ! deleted
306 ? pickle
306 ? pickle
307 ? unknown
307 ? unknown
308 A added
308 A added
309 A copied
309 A copied
310 C .hgignore
310 C .hgignore
311 C modified
311 C modified
312 I ignored
312 I ignored
313 R removed
313 R removed
314 $ rm pickle
314 $ rm pickle
315
315
316 $ echo "^ignoreddir$" > .hgignore
316 $ echo "^ignoreddir$" > .hgignore
317 $ mkdir ignoreddir
317 $ mkdir ignoreddir
318 $ touch ignoreddir/file
318 $ touch ignoreddir/file
319
319
320 Test templater support:
320 Test templater support:
321
321
322 $ hg status -AT "[{status}]\t{if(source, '{source} -> ')}{path}\n"
322 $ hg status -AT "[{status}]\t{if(source, '{source} -> ')}{path}\n"
323 [M] .hgignore
323 [M] .hgignore
324 [A] added
324 [A] added
325 [A] modified -> copied
325 [A] modified -> copied
326 [R] removed
326 [R] removed
327 [!] deleted
327 [!] deleted
328 [?] ignored
328 [?] ignored
329 [?] unknown
329 [?] unknown
330 [I] ignoreddir/file
330 [I] ignoreddir/file
331 [C] modified
331 [C] modified
332 $ hg status -AT default
332 $ hg status -AT default
333 M .hgignore
333 M .hgignore
334 A added
334 A added
335 A copied
335 A copied
336 modified
336 modified
337 R removed
337 R removed
338 ! deleted
338 ! deleted
339 ? ignored
339 ? ignored
340 ? unknown
340 ? unknown
341 I ignoreddir/file
341 I ignoreddir/file
342 C modified
342 C modified
343 $ hg status -T compact
343 $ hg status -T compact
344 abort: "status" not in template map
344 abort: "status" not in template map
345 [255]
345 [255]
346
346
347 hg status ignoreddir/file:
347 hg status ignoreddir/file:
348
348
349 $ hg status ignoreddir/file
349 $ hg status ignoreddir/file
350
350
351 hg status -i ignoreddir/file:
351 hg status -i ignoreddir/file:
352
352
353 $ hg status -i ignoreddir/file
353 $ hg status -i ignoreddir/file
354 I ignoreddir/file
354 I ignoreddir/file
355 $ cd ..
355 $ cd ..
356
356
357 Check 'status -q' and some combinations
357 Check 'status -q' and some combinations
358
358
359 $ hg init repo3
359 $ hg init repo3
360 $ cd repo3
360 $ cd repo3
361 $ touch modified removed deleted ignored
361 $ touch modified removed deleted ignored
362 $ echo "^ignored$" > .hgignore
362 $ echo "^ignored$" > .hgignore
363 $ hg commit -A -m 'initial checkin'
363 $ hg commit -A -m 'initial checkin'
364 adding .hgignore
364 adding .hgignore
365 adding deleted
365 adding deleted
366 adding modified
366 adding modified
367 adding removed
367 adding removed
368 $ touch added unknown ignored
368 $ touch added unknown ignored
369 $ hg add added
369 $ hg add added
370 $ echo "test" >> modified
370 $ echo "test" >> modified
371 $ hg remove removed
371 $ hg remove removed
372 $ rm deleted
372 $ rm deleted
373 $ hg copy modified copied
373 $ hg copy modified copied
374
374
375 Specify working directory revision explicitly, that should be the same as
375 Specify working directory revision explicitly, that should be the same as
376 "hg status"
376 "hg status"
377
377
378 $ hg status --change "wdir()"
378 $ hg status --change "wdir()"
379 M modified
379 M modified
380 A added
380 A added
381 A copied
381 A copied
382 R removed
382 R removed
383 ! deleted
383 ! deleted
384 ? unknown
384 ? unknown
385
385
386 Run status with 2 different flags.
386 Run status with 2 different flags.
387 Check if result is the same or different.
387 Check if result is the same or different.
388 If result is not as expected, raise error
388 If result is not as expected, raise error
389
389
390 $ assert() {
390 $ assert() {
391 > hg status $1 > ../a
391 > hg status $1 > ../a
392 > hg status $2 > ../b
392 > hg status $2 > ../b
393 > if diff ../a ../b > /dev/null; then
393 > if diff ../a ../b > /dev/null; then
394 > out=0
394 > out=0
395 > else
395 > else
396 > out=1
396 > out=1
397 > fi
397 > fi
398 > if [ $3 -eq 0 ]; then
398 > if [ $3 -eq 0 ]; then
399 > df="same"
399 > df="same"
400 > else
400 > else
401 > df="different"
401 > df="different"
402 > fi
402 > fi
403 > if [ $out -ne $3 ]; then
403 > if [ $out -ne $3 ]; then
404 > echo "Error on $1 and $2, should be $df."
404 > echo "Error on $1 and $2, should be $df."
405 > fi
405 > fi
406 > }
406 > }
407
407
408 Assert flag1 flag2 [0-same | 1-different]
408 Assert flag1 flag2 [0-same | 1-different]
409
409
410 $ assert "-q" "-mard" 0
410 $ assert "-q" "-mard" 0
411 $ assert "-A" "-marduicC" 0
411 $ assert "-A" "-marduicC" 0
412 $ assert "-qA" "-mardcC" 0
412 $ assert "-qA" "-mardcC" 0
413 $ assert "-qAui" "-A" 0
413 $ assert "-qAui" "-A" 0
414 $ assert "-qAu" "-marducC" 0
414 $ assert "-qAu" "-marducC" 0
415 $ assert "-qAi" "-mardicC" 0
415 $ assert "-qAi" "-mardicC" 0
416 $ assert "-qu" "-u" 0
416 $ assert "-qu" "-u" 0
417 $ assert "-q" "-u" 1
417 $ assert "-q" "-u" 1
418 $ assert "-m" "-a" 1
418 $ assert "-m" "-a" 1
419 $ assert "-r" "-d" 1
419 $ assert "-r" "-d" 1
420 $ cd ..
420 $ cd ..
421
421
422 $ hg init repo4
422 $ hg init repo4
423 $ cd repo4
423 $ cd repo4
424 $ touch modified removed deleted
424 $ touch modified removed deleted
425 $ hg ci -q -A -m 'initial checkin'
425 $ hg ci -q -A -m 'initial checkin'
426 $ touch added unknown
426 $ touch added unknown
427 $ hg add added
427 $ hg add added
428 $ hg remove removed
428 $ hg remove removed
429 $ rm deleted
429 $ rm deleted
430 $ echo x > modified
430 $ echo x > modified
431 $ hg copy modified copied
431 $ hg copy modified copied
432 $ hg ci -m 'test checkin' -d "1000001 0"
432 $ hg ci -m 'test checkin' -d "1000001 0"
433 $ rm *
433 $ rm *
434 $ touch unrelated
434 $ touch unrelated
435 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
435 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
436
436
437 hg status --change 1:
437 hg status --change 1:
438
438
439 $ hg status --change 1
439 $ hg status --change 1
440 M modified
440 M modified
441 A added
441 A added
442 A copied
442 A copied
443 R removed
443 R removed
444
444
445 hg status --change 1 unrelated:
445 hg status --change 1 unrelated:
446
446
447 $ hg status --change 1 unrelated
447 $ hg status --change 1 unrelated
448
448
449 hg status -C --change 1 added modified copied removed deleted:
449 hg status -C --change 1 added modified copied removed deleted:
450
450
451 $ hg status -C --change 1 added modified copied removed deleted
451 $ hg status -C --change 1 added modified copied removed deleted
452 M modified
452 M modified
453 A added
453 A added
454 A copied
454 A copied
455 modified
455 modified
456 R removed
456 R removed
457
457
458 hg status -A --change 1 and revset:
458 hg status -A --change 1 and revset:
459
459
460 $ hg status -A --change '1|1'
460 $ hg status -A --change '1|1'
461 M modified
461 M modified
462 A added
462 A added
463 A copied
463 A copied
464 modified
464 modified
465 R removed
465 R removed
466 C deleted
466 C deleted
467
467
468 $ cd ..
468 $ cd ..
469
469
470 hg status with --rev and reverted changes:
470 hg status with --rev and reverted changes:
471
471
472 $ hg init reverted-changes-repo
472 $ hg init reverted-changes-repo
473 $ cd reverted-changes-repo
473 $ cd reverted-changes-repo
474 $ echo a > file
474 $ echo a > file
475 $ hg add file
475 $ hg add file
476 $ hg ci -m a
476 $ hg ci -m a
477 $ echo b > file
477 $ echo b > file
478 $ hg ci -m b
478 $ hg ci -m b
479
479
480 reverted file should appear clean
480 reverted file should appear clean
481
481
482 $ hg revert -r 0 .
482 $ hg revert -r 0 .
483 reverting file
483 reverting file
484 $ hg status -A --rev 0
484 $ hg status -A --rev 0
485 C file
485 C file
486
486
487 #if execbit
487 #if execbit
488 reverted file with changed flag should appear modified
488 reverted file with changed flag should appear modified
489
489
490 $ chmod +x file
490 $ chmod +x file
491 $ hg status -A --rev 0
491 $ hg status -A --rev 0
492 M file
492 M file
493
493
494 $ hg revert -r 0 .
494 $ hg revert -r 0 .
495 reverting file
495 reverting file
496
496
497 reverted and committed file with changed flag should appear modified
497 reverted and committed file with changed flag should appear modified
498
498
499 $ hg co -C .
499 $ hg co -C .
500 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
501 $ chmod +x file
501 $ chmod +x file
502 $ hg ci -m 'change flag'
502 $ hg ci -m 'change flag'
503 $ hg status -A --rev 1 --rev 2
503 $ hg status -A --rev 1 --rev 2
504 M file
504 M file
505 $ hg diff -r 1 -r 2
505 $ hg diff -r 1 -r 2
506
506
507 #endif
507 #endif
508
508
509 $ cd ..
509 $ cd ..
510
510
511 hg status of binary file starting with '\1\n', a separator for metadata:
511 hg status of binary file starting with '\1\n', a separator for metadata:
512
512
513 $ hg init repo5
513 $ hg init repo5
514 $ cd repo5
514 $ cd repo5
515 >>> open("010a", r"wb").write(b"\1\nfoo") and None
515 >>> open("010a", r"wb").write(b"\1\nfoo") and None
516 $ hg ci -q -A -m 'initial checkin'
516 $ hg ci -q -A -m 'initial checkin'
517 $ hg status -A
517 $ hg status -A
518 C 010a
518 C 010a
519
519
520 >>> open("010a", r"wb").write(b"\1\nbar") and None
520 >>> open("010a", r"wb").write(b"\1\nbar") and None
521 $ hg status -A
521 $ hg status -A
522 M 010a
522 M 010a
523 $ hg ci -q -m 'modify 010a'
523 $ hg ci -q -m 'modify 010a'
524 $ hg status -A --rev 0:1
524 $ hg status -A --rev 0:1
525 M 010a
525 M 010a
526
526
527 $ touch empty
527 $ touch empty
528 $ hg ci -q -A -m 'add another file'
528 $ hg ci -q -A -m 'add another file'
529 $ hg status -A --rev 1:2 010a
529 $ hg status -A --rev 1:2 010a
530 C 010a
530 C 010a
531
531
532 $ cd ..
532 $ cd ..
533
533
534 test "hg status" with "directory pattern" which matches against files
534 test "hg status" with "directory pattern" which matches against files
535 only known on target revision.
535 only known on target revision.
536
536
537 $ hg init repo6
537 $ hg init repo6
538 $ cd repo6
538 $ cd repo6
539
539
540 $ echo a > a.txt
540 $ echo a > a.txt
541 $ hg add a.txt
541 $ hg add a.txt
542 $ hg commit -m '#0'
542 $ hg commit -m '#0'
543 $ mkdir -p 1/2/3/4/5
543 $ mkdir -p 1/2/3/4/5
544 $ echo b > 1/2/3/4/5/b.txt
544 $ echo b > 1/2/3/4/5/b.txt
545 $ hg add 1/2/3/4/5/b.txt
545 $ hg add 1/2/3/4/5/b.txt
546 $ hg commit -m '#1'
546 $ hg commit -m '#1'
547
547
548 $ hg update -C 0 > /dev/null
548 $ hg update -C 0 > /dev/null
549 $ hg status -A
549 $ hg status -A
550 C a.txt
550 C a.txt
551
551
552 the directory matching against specified pattern should be removed,
552 the directory matching against specified pattern should be removed,
553 because directory existence prevents 'dirstate.walk()' from showing
553 because directory existence prevents 'dirstate.walk()' from showing
554 warning message about such pattern.
554 warning message about such pattern.
555
555
556 $ test ! -d 1
556 $ test ! -d 1
557 $ hg status -A --rev 1 1/2/3/4/5/b.txt
557 $ hg status -A --rev 1 1/2/3/4/5/b.txt
558 R 1/2/3/4/5/b.txt
558 R 1/2/3/4/5/b.txt
559 $ hg status -A --rev 1 1/2/3/4/5
559 $ hg status -A --rev 1 1/2/3/4/5
560 R 1/2/3/4/5/b.txt
560 R 1/2/3/4/5/b.txt
561 $ hg status -A --rev 1 1/2/3
561 $ hg status -A --rev 1 1/2/3
562 R 1/2/3/4/5/b.txt
562 R 1/2/3/4/5/b.txt
563 $ hg status -A --rev 1 1
563 $ hg status -A --rev 1 1
564 R 1/2/3/4/5/b.txt
564 R 1/2/3/4/5/b.txt
565
565
566 $ hg status --config ui.formatdebug=True --rev 1 1
566 $ hg status --config ui.formatdebug=True --rev 1 1
567 status = [
567 status = [
568 {
568 {
569 'itemtype': 'file',
569 'itemtype': 'file',
570 'path': '1/2/3/4/5/b.txt',
570 'path': '1/2/3/4/5/b.txt',
571 'status': 'R'
571 'status': 'R'
572 },
572 },
573 ]
573 ]
574
574
575 #if windows
575 #if windows
576 $ hg --config ui.slash=false status -A --rev 1 1
576 $ hg --config ui.slash=false status -A --rev 1 1
577 R 1\2\3\4\5\b.txt
577 R 1\2\3\4\5\b.txt
578 #endif
578 #endif
579
579
580 $ cd ..
580 $ cd ..
581
581
582 Status after move overwriting a file (issue4458)
582 Status after move overwriting a file (issue4458)
583 =================================================
583 =================================================
584
584
585
585
586 $ hg init issue4458
586 $ hg init issue4458
587 $ cd issue4458
587 $ cd issue4458
588 $ echo a > a
588 $ echo a > a
589 $ echo b > b
589 $ echo b > b
590 $ hg commit -Am base
590 $ hg commit -Am base
591 adding a
591 adding a
592 adding b
592 adding b
593
593
594
594
595 with --force
595 with --force
596
596
597 $ hg mv b --force a
597 $ hg mv b --force a
598 $ hg st --copies
598 $ hg st --copies
599 M a
599 M a
600 b
600 b
601 R b
601 R b
602 $ hg revert --all
602 $ hg revert --all
603 reverting a
603 reverting a
604 undeleting b
604 undeleting b
605 $ rm *.orig
605 $ rm *.orig
606
606
607 without force
607 without force
608
608
609 $ hg rm a
609 $ hg rm a
610 $ hg st --copies
610 $ hg st --copies
611 R a
611 R a
612 $ hg mv b a
612 $ hg mv b a
613 $ hg st --copies
613 $ hg st --copies
614 M a
614 M a
615 b
615 b
616 R b
616 R b
617
617
618 using ui.statuscopies setting
618 using ui.statuscopies setting
619 $ hg st --config ui.statuscopies=true
619 $ hg st --config ui.statuscopies=true
620 M a
620 M a
621 b
621 b
622 R b
622 R b
623 $ hg st --config ui.statuscopies=false
623 $ hg st --config ui.statuscopies=false
624 M a
624 M a
625 R b
625 R b
626 $ hg st --config ui.tweakdefaults=yes
626 $ hg st --config ui.tweakdefaults=yes
627 M a
627 M a
628 b
628 b
629 R b
629 R b
630
630
631 using log status template (issue5155)
631 using log status template (issue5155)
632 $ hg log -Tstatus -r 'wdir()' -C
632 $ hg log -Tstatus -r 'wdir()' -C
633 changeset: 2147483647:ffffffffffff
633 changeset: 2147483647:ffffffffffff
634 parent: 0:8c55c58b4c0e
634 parent: 0:8c55c58b4c0e
635 user: test
635 user: test
636 date: * (glob)
636 date: * (glob)
637 files:
637 files:
638 M a
638 M a
639 b
639 b
640 R b
640 R b
641
641
642 $ hg log -GTstatus -r 'wdir()' -C
642 $ hg log -GTstatus -r 'wdir()' -C
643 o changeset: 2147483647:ffffffffffff
643 o changeset: 2147483647:ffffffffffff
644 | parent: 0:8c55c58b4c0e
644 | parent: 0:8c55c58b4c0e
645 ~ user: test
645 ~ user: test
646 date: * (glob)
646 date: * (glob)
647 files:
647 files:
648 M a
648 M a
649 b
649 b
650 R b
650 R b
651
651
652
652
653 Other "bug" highlight, the revision status does not report the copy information.
653 Other "bug" highlight, the revision status does not report the copy information.
654 This is buggy behavior.
654 This is buggy behavior.
655
655
656 $ hg commit -m 'blah'
656 $ hg commit -m 'blah'
657 $ hg st --copies --change .
657 $ hg st --copies --change .
658 M a
658 M a
659 R b
659 R b
660
660
661 using log status template, the copy information is displayed correctly.
661 using log status template, the copy information is displayed correctly.
662 $ hg log -Tstatus -r. -C
662 $ hg log -Tstatus -r. -C
663 changeset: 1:6685fde43d21
663 changeset: 1:6685fde43d21
664 tag: tip
664 tag: tip
665 user: test
665 user: test
666 date: * (glob)
666 date: * (glob)
667 summary: blah
667 summary: blah
668 files:
668 files:
669 M a
669 M a
670 b
670 b
671 R b
671 R b
672
672
673
673
674 $ cd ..
674 $ cd ..
675
675
676 Make sure .hg doesn't show up even as a symlink
676 Make sure .hg doesn't show up even as a symlink
677
677
678 $ hg init repo0
678 $ hg init repo0
679 $ mkdir symlink-repo0
679 $ mkdir symlink-repo0
680 $ cd symlink-repo0
680 $ cd symlink-repo0
681 $ ln -s ../repo0/.hg
681 $ ln -s ../repo0/.hg
682 $ hg status
682 $ hg status
683
684 Check using include flag with pattern when status does not need to traverse
685 the working directory (issue6483)
686
687 $ cd ..
688 $ hg init issue6483
689 $ cd issue6483
690 $ touch a.py b.rs
691 $ hg add a.py b.rs
692 $ hg st -aI "*.py"
693 A a.py
694 A b.rs (known-bad-output rust !)
General Comments 0
You need to be logged in to leave comments. Login now