##// END OF EJS Templates
tests: properly drop back to root dir in test-status.t
Ryan McElroy -
r31423:568d80b2 default
parent child Browse files
Show More
@@ -1,550 +1,552 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 $ cd ..
110 $ cd ..
111
111
112 $ hg init repo2
112 $ hg init repo2
113 $ cd repo2
113 $ cd repo2
114 $ touch modified removed deleted ignored
114 $ touch modified removed deleted ignored
115 $ echo "^ignored$" > .hgignore
115 $ echo "^ignored$" > .hgignore
116 $ hg ci -A -m 'initial checkin'
116 $ hg ci -A -m 'initial checkin'
117 adding .hgignore
117 adding .hgignore
118 adding deleted
118 adding deleted
119 adding modified
119 adding modified
120 adding removed
120 adding removed
121 $ touch modified added unknown ignored
121 $ touch modified added unknown ignored
122 $ hg add added
122 $ hg add added
123 $ hg remove removed
123 $ hg remove removed
124 $ rm deleted
124 $ rm deleted
125
125
126 hg status:
126 hg status:
127
127
128 $ hg status
128 $ hg status
129 A added
129 A added
130 R removed
130 R removed
131 ! deleted
131 ! deleted
132 ? unknown
132 ? unknown
133
133
134 hg status modified added removed deleted unknown never-existed ignored:
134 hg status modified added removed deleted unknown never-existed ignored:
135
135
136 $ hg status modified added removed deleted unknown never-existed ignored
136 $ hg status modified added removed deleted unknown never-existed ignored
137 never-existed: * (glob)
137 never-existed: * (glob)
138 A added
138 A added
139 R removed
139 R removed
140 ! deleted
140 ! deleted
141 ? unknown
141 ? unknown
142
142
143 $ hg copy modified copied
143 $ hg copy modified copied
144
144
145 hg status -C:
145 hg status -C:
146
146
147 $ hg status -C
147 $ hg status -C
148 A added
148 A added
149 A copied
149 A copied
150 modified
150 modified
151 R removed
151 R removed
152 ! deleted
152 ! deleted
153 ? unknown
153 ? unknown
154
154
155 hg status -A:
155 hg status -A:
156
156
157 $ hg status -A
157 $ hg status -A
158 A added
158 A added
159 A copied
159 A copied
160 modified
160 modified
161 R removed
161 R removed
162 ! deleted
162 ! deleted
163 ? unknown
163 ? unknown
164 I ignored
164 I ignored
165 C .hgignore
165 C .hgignore
166 C modified
166 C modified
167
167
168 $ hg status -A -Tjson
168 $ hg status -A -Tjson
169 [
169 [
170 {
170 {
171 "path": "added",
171 "path": "added",
172 "status": "A"
172 "status": "A"
173 },
173 },
174 {
174 {
175 "copy": "modified",
175 "copy": "modified",
176 "path": "copied",
176 "path": "copied",
177 "status": "A"
177 "status": "A"
178 },
178 },
179 {
179 {
180 "path": "removed",
180 "path": "removed",
181 "status": "R"
181 "status": "R"
182 },
182 },
183 {
183 {
184 "path": "deleted",
184 "path": "deleted",
185 "status": "!"
185 "status": "!"
186 },
186 },
187 {
187 {
188 "path": "unknown",
188 "path": "unknown",
189 "status": "?"
189 "status": "?"
190 },
190 },
191 {
191 {
192 "path": "ignored",
192 "path": "ignored",
193 "status": "I"
193 "status": "I"
194 },
194 },
195 {
195 {
196 "path": ".hgignore",
196 "path": ".hgignore",
197 "status": "C"
197 "status": "C"
198 },
198 },
199 {
199 {
200 "path": "modified",
200 "path": "modified",
201 "status": "C"
201 "status": "C"
202 }
202 }
203 ]
203 ]
204
204
205 $ hg status -A -Tpickle > pickle
205 $ hg status -A -Tpickle > pickle
206 >>> from __future__ import print_function
206 >>> from __future__ import print_function
207 >>> import pickle
207 >>> import pickle
208 >>> print(sorted((x['status'], x['path']) for x in pickle.load(open("pickle"))))
208 >>> print(sorted((x['status'], x['path']) for x in pickle.load(open("pickle"))))
209 [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')]
209 [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')]
210 $ rm pickle
210 $ rm pickle
211
211
212 $ echo "^ignoreddir$" > .hgignore
212 $ echo "^ignoreddir$" > .hgignore
213 $ mkdir ignoreddir
213 $ mkdir ignoreddir
214 $ touch ignoreddir/file
214 $ touch ignoreddir/file
215
215
216 Test templater support:
216 Test templater support:
217
217
218 $ hg status -AT "[{status}]\t{if(copy, '{copy} -> ')}{path}\n"
218 $ hg status -AT "[{status}]\t{if(copy, '{copy} -> ')}{path}\n"
219 [M] .hgignore
219 [M] .hgignore
220 [A] added
220 [A] added
221 [A] modified -> copied
221 [A] modified -> copied
222 [R] removed
222 [R] removed
223 [!] deleted
223 [!] deleted
224 [?] ignored
224 [?] ignored
225 [?] unknown
225 [?] unknown
226 [I] ignoreddir/file
226 [I] ignoreddir/file
227 [C] modified
227 [C] modified
228 $ hg status -AT default
228 $ hg status -AT default
229 M .hgignore
229 M .hgignore
230 A added
230 A added
231 A copied
231 A copied
232 modified
232 modified
233 R removed
233 R removed
234 ! deleted
234 ! deleted
235 ? ignored
235 ? ignored
236 ? unknown
236 ? unknown
237 I ignoreddir/file
237 I ignoreddir/file
238 C modified
238 C modified
239 $ hg status -T compact
239 $ hg status -T compact
240 abort: "status" not in template map
240 abort: "status" not in template map
241 [255]
241 [255]
242
242
243 hg status ignoreddir/file:
243 hg status ignoreddir/file:
244
244
245 $ hg status ignoreddir/file
245 $ hg status ignoreddir/file
246
246
247 hg status -i ignoreddir/file:
247 hg status -i ignoreddir/file:
248
248
249 $ hg status -i ignoreddir/file
249 $ hg status -i ignoreddir/file
250 I ignoreddir/file
250 I ignoreddir/file
251 $ cd ..
251 $ cd ..
252
252
253 Check 'status -q' and some combinations
253 Check 'status -q' and some combinations
254
254
255 $ hg init repo3
255 $ hg init repo3
256 $ cd repo3
256 $ cd repo3
257 $ touch modified removed deleted ignored
257 $ touch modified removed deleted ignored
258 $ echo "^ignored$" > .hgignore
258 $ echo "^ignored$" > .hgignore
259 $ hg commit -A -m 'initial checkin'
259 $ hg commit -A -m 'initial checkin'
260 adding .hgignore
260 adding .hgignore
261 adding deleted
261 adding deleted
262 adding modified
262 adding modified
263 adding removed
263 adding removed
264 $ touch added unknown ignored
264 $ touch added unknown ignored
265 $ hg add added
265 $ hg add added
266 $ echo "test" >> modified
266 $ echo "test" >> modified
267 $ hg remove removed
267 $ hg remove removed
268 $ rm deleted
268 $ rm deleted
269 $ hg copy modified copied
269 $ hg copy modified copied
270
270
271 Specify working directory revision explicitly, that should be the same as
271 Specify working directory revision explicitly, that should be the same as
272 "hg status"
272 "hg status"
273
273
274 $ hg status --change "wdir()"
274 $ hg status --change "wdir()"
275 M modified
275 M modified
276 A added
276 A added
277 A copied
277 A copied
278 R removed
278 R removed
279 ! deleted
279 ! deleted
280 ? unknown
280 ? unknown
281
281
282 Run status with 2 different flags.
282 Run status with 2 different flags.
283 Check if result is the same or different.
283 Check if result is the same or different.
284 If result is not as expected, raise error
284 If result is not as expected, raise error
285
285
286 $ assert() {
286 $ assert() {
287 > hg status $1 > ../a
287 > hg status $1 > ../a
288 > hg status $2 > ../b
288 > hg status $2 > ../b
289 > if diff ../a ../b > /dev/null; then
289 > if diff ../a ../b > /dev/null; then
290 > out=0
290 > out=0
291 > else
291 > else
292 > out=1
292 > out=1
293 > fi
293 > fi
294 > if [ $3 -eq 0 ]; then
294 > if [ $3 -eq 0 ]; then
295 > df="same"
295 > df="same"
296 > else
296 > else
297 > df="different"
297 > df="different"
298 > fi
298 > fi
299 > if [ $out -ne $3 ]; then
299 > if [ $out -ne $3 ]; then
300 > echo "Error on $1 and $2, should be $df."
300 > echo "Error on $1 and $2, should be $df."
301 > fi
301 > fi
302 > }
302 > }
303
303
304 Assert flag1 flag2 [0-same | 1-different]
304 Assert flag1 flag2 [0-same | 1-different]
305
305
306 $ assert "-q" "-mard" 0
306 $ assert "-q" "-mard" 0
307 $ assert "-A" "-marduicC" 0
307 $ assert "-A" "-marduicC" 0
308 $ assert "-qA" "-mardcC" 0
308 $ assert "-qA" "-mardcC" 0
309 $ assert "-qAui" "-A" 0
309 $ assert "-qAui" "-A" 0
310 $ assert "-qAu" "-marducC" 0
310 $ assert "-qAu" "-marducC" 0
311 $ assert "-qAi" "-mardicC" 0
311 $ assert "-qAi" "-mardicC" 0
312 $ assert "-qu" "-u" 0
312 $ assert "-qu" "-u" 0
313 $ assert "-q" "-u" 1
313 $ assert "-q" "-u" 1
314 $ assert "-m" "-a" 1
314 $ assert "-m" "-a" 1
315 $ assert "-r" "-d" 1
315 $ assert "-r" "-d" 1
316 $ cd ..
316 $ cd ..
317
317
318 $ hg init repo4
318 $ hg init repo4
319 $ cd repo4
319 $ cd repo4
320 $ touch modified removed deleted
320 $ touch modified removed deleted
321 $ hg ci -q -A -m 'initial checkin'
321 $ hg ci -q -A -m 'initial checkin'
322 $ touch added unknown
322 $ touch added unknown
323 $ hg add added
323 $ hg add added
324 $ hg remove removed
324 $ hg remove removed
325 $ rm deleted
325 $ rm deleted
326 $ echo x > modified
326 $ echo x > modified
327 $ hg copy modified copied
327 $ hg copy modified copied
328 $ hg ci -m 'test checkin' -d "1000001 0"
328 $ hg ci -m 'test checkin' -d "1000001 0"
329 $ rm *
329 $ rm *
330 $ touch unrelated
330 $ touch unrelated
331 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
331 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
332
332
333 hg status --change 1:
333 hg status --change 1:
334
334
335 $ hg status --change 1
335 $ hg status --change 1
336 M modified
336 M modified
337 A added
337 A added
338 A copied
338 A copied
339 R removed
339 R removed
340
340
341 hg status --change 1 unrelated:
341 hg status --change 1 unrelated:
342
342
343 $ hg status --change 1 unrelated
343 $ hg status --change 1 unrelated
344
344
345 hg status -C --change 1 added modified copied removed deleted:
345 hg status -C --change 1 added modified copied removed deleted:
346
346
347 $ hg status -C --change 1 added modified copied removed deleted
347 $ hg status -C --change 1 added modified copied removed deleted
348 M modified
348 M modified
349 A added
349 A added
350 A copied
350 A copied
351 modified
351 modified
352 R removed
352 R removed
353
353
354 hg status -A --change 1 and revset:
354 hg status -A --change 1 and revset:
355
355
356 $ hg status -A --change '1|1'
356 $ hg status -A --change '1|1'
357 M modified
357 M modified
358 A added
358 A added
359 A copied
359 A copied
360 modified
360 modified
361 R removed
361 R removed
362 C deleted
362 C deleted
363
363
364 $ cd ..
364 $ cd ..
365
365
366 hg status with --rev and reverted changes:
366 hg status with --rev and reverted changes:
367
367
368 $ hg init reverted-changes-repo
368 $ hg init reverted-changes-repo
369 $ cd reverted-changes-repo
369 $ cd reverted-changes-repo
370 $ echo a > file
370 $ echo a > file
371 $ hg add file
371 $ hg add file
372 $ hg ci -m a
372 $ hg ci -m a
373 $ echo b > file
373 $ echo b > file
374 $ hg ci -m b
374 $ hg ci -m b
375
375
376 reverted file should appear clean
376 reverted file should appear clean
377
377
378 $ hg revert -r 0 .
378 $ hg revert -r 0 .
379 reverting file
379 reverting file
380 $ hg status -A --rev 0
380 $ hg status -A --rev 0
381 C file
381 C file
382
382
383 #if execbit
383 #if execbit
384 reverted file with changed flag should appear modified
384 reverted file with changed flag should appear modified
385
385
386 $ chmod +x file
386 $ chmod +x file
387 $ hg status -A --rev 0
387 $ hg status -A --rev 0
388 M file
388 M file
389
389
390 $ hg revert -r 0 .
390 $ hg revert -r 0 .
391 reverting file
391 reverting file
392
392
393 reverted and committed file with changed flag should appear modified
393 reverted and committed file with changed flag should appear modified
394
394
395 $ hg co -C .
395 $ hg co -C .
396 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
397 $ chmod +x file
397 $ chmod +x file
398 $ hg ci -m 'change flag'
398 $ hg ci -m 'change flag'
399 $ hg status -A --rev 1 --rev 2
399 $ hg status -A --rev 1 --rev 2
400 M file
400 M file
401 $ hg diff -r 1 -r 2
401 $ hg diff -r 1 -r 2
402
402
403 #endif
403 #endif
404
404
405 $ cd ..
406
405 hg status of binary file starting with '\1\n', a separator for metadata:
407 hg status of binary file starting with '\1\n', a separator for metadata:
406
408
407 $ hg init repo5
409 $ hg init repo5
408 $ cd repo5
410 $ cd repo5
409 >>> open("010a", "wb").write("\1\nfoo")
411 >>> open("010a", "wb").write("\1\nfoo")
410 $ hg ci -q -A -m 'initial checkin'
412 $ hg ci -q -A -m 'initial checkin'
411 $ hg status -A
413 $ hg status -A
412 C 010a
414 C 010a
413
415
414 >>> open("010a", "wb").write("\1\nbar")
416 >>> open("010a", "wb").write("\1\nbar")
415 $ hg status -A
417 $ hg status -A
416 M 010a
418 M 010a
417 $ hg ci -q -m 'modify 010a'
419 $ hg ci -q -m 'modify 010a'
418 $ hg status -A --rev 0:1
420 $ hg status -A --rev 0:1
419 M 010a
421 M 010a
420
422
421 $ touch empty
423 $ touch empty
422 $ hg ci -q -A -m 'add another file'
424 $ hg ci -q -A -m 'add another file'
423 $ hg status -A --rev 1:2 010a
425 $ hg status -A --rev 1:2 010a
424 C 010a
426 C 010a
425
427
426 $ cd ..
428 $ cd ..
427
429
428 test "hg status" with "directory pattern" which matches against files
430 test "hg status" with "directory pattern" which matches against files
429 only known on target revision.
431 only known on target revision.
430
432
431 $ hg init repo6
433 $ hg init repo6
432 $ cd repo6
434 $ cd repo6
433
435
434 $ echo a > a.txt
436 $ echo a > a.txt
435 $ hg add a.txt
437 $ hg add a.txt
436 $ hg commit -m '#0'
438 $ hg commit -m '#0'
437 $ mkdir -p 1/2/3/4/5
439 $ mkdir -p 1/2/3/4/5
438 $ echo b > 1/2/3/4/5/b.txt
440 $ echo b > 1/2/3/4/5/b.txt
439 $ hg add 1/2/3/4/5/b.txt
441 $ hg add 1/2/3/4/5/b.txt
440 $ hg commit -m '#1'
442 $ hg commit -m '#1'
441
443
442 $ hg update -C 0 > /dev/null
444 $ hg update -C 0 > /dev/null
443 $ hg status -A
445 $ hg status -A
444 C a.txt
446 C a.txt
445
447
446 the directory matching against specified pattern should be removed,
448 the directory matching against specified pattern should be removed,
447 because directory existence prevents 'dirstate.walk()' from showing
449 because directory existence prevents 'dirstate.walk()' from showing
448 warning message about such pattern.
450 warning message about such pattern.
449
451
450 $ test ! -d 1
452 $ test ! -d 1
451 $ hg status -A --rev 1 1/2/3/4/5/b.txt
453 $ hg status -A --rev 1 1/2/3/4/5/b.txt
452 R 1/2/3/4/5/b.txt
454 R 1/2/3/4/5/b.txt
453 $ hg status -A --rev 1 1/2/3/4/5
455 $ hg status -A --rev 1 1/2/3/4/5
454 R 1/2/3/4/5/b.txt
456 R 1/2/3/4/5/b.txt
455 $ hg status -A --rev 1 1/2/3
457 $ hg status -A --rev 1 1/2/3
456 R 1/2/3/4/5/b.txt
458 R 1/2/3/4/5/b.txt
457 $ hg status -A --rev 1 1
459 $ hg status -A --rev 1 1
458 R 1/2/3/4/5/b.txt
460 R 1/2/3/4/5/b.txt
459
461
460 $ hg status --config ui.formatdebug=True --rev 1 1
462 $ hg status --config ui.formatdebug=True --rev 1 1
461 status = [
463 status = [
462 {*'path': '1/2/3/4/5/b.txt'*}, (glob)
464 {*'path': '1/2/3/4/5/b.txt'*}, (glob)
463 ]
465 ]
464
466
465 #if windows
467 #if windows
466 $ hg --config ui.slash=false status -A --rev 1 1
468 $ hg --config ui.slash=false status -A --rev 1 1
467 R 1\2\3\4\5\b.txt
469 R 1\2\3\4\5\b.txt
468 #endif
470 #endif
469
471
470 $ cd ..
472 $ cd ..
471
473
472 Status after move overwriting a file (issue4458)
474 Status after move overwriting a file (issue4458)
473 =================================================
475 =================================================
474
476
475
477
476 $ hg init issue4458
478 $ hg init issue4458
477 $ cd issue4458
479 $ cd issue4458
478 $ echo a > a
480 $ echo a > a
479 $ echo b > b
481 $ echo b > b
480 $ hg commit -Am base
482 $ hg commit -Am base
481 adding a
483 adding a
482 adding b
484 adding b
483
485
484
486
485 with --force
487 with --force
486
488
487 $ hg mv b --force a
489 $ hg mv b --force a
488 $ hg st --copies
490 $ hg st --copies
489 M a
491 M a
490 b
492 b
491 R b
493 R b
492 $ hg revert --all
494 $ hg revert --all
493 reverting a
495 reverting a
494 undeleting b
496 undeleting b
495 $ rm *.orig
497 $ rm *.orig
496
498
497 without force
499 without force
498
500
499 $ hg rm a
501 $ hg rm a
500 $ hg st --copies
502 $ hg st --copies
501 R a
503 R a
502 $ hg mv b a
504 $ hg mv b a
503 $ hg st --copies
505 $ hg st --copies
504 M a
506 M a
505 b
507 b
506 R b
508 R b
507
509
508 using ui.statuscopies setting
510 using ui.statuscopies setting
509 $ hg st --config ui.statuscopies=true
511 $ hg st --config ui.statuscopies=true
510 M a
512 M a
511 b
513 b
512 R b
514 R b
513 $ hg st --config ui.statuscopies=false
515 $ hg st --config ui.statuscopies=false
514 M a
516 M a
515 R b
517 R b
516
518
517 using log status template (issue5155)
519 using log status template (issue5155)
518 $ hg log -Tstatus -r 'wdir()' -C
520 $ hg log -Tstatus -r 'wdir()' -C
519 changeset: 2147483647:ffffffffffff
521 changeset: 2147483647:ffffffffffff
520 parent: 0:8c55c58b4c0e
522 parent: 0:8c55c58b4c0e
521 user: test
523 user: test
522 date: * (glob)
524 date: * (glob)
523 files:
525 files:
524 M a
526 M a
525 b
527 b
526 R b
528 R b
527
529
528
530
529 Other "bug" highlight, the revision status does not report the copy information.
531 Other "bug" highlight, the revision status does not report the copy information.
530 This is buggy behavior.
532 This is buggy behavior.
531
533
532 $ hg commit -m 'blah'
534 $ hg commit -m 'blah'
533 $ hg st --copies --change .
535 $ hg st --copies --change .
534 M a
536 M a
535 R b
537 R b
536
538
537 using log status template, the copy information is displayed correctly.
539 using log status template, the copy information is displayed correctly.
538 $ hg log -Tstatus -r. -C
540 $ hg log -Tstatus -r. -C
539 changeset: 1:6685fde43d21
541 changeset: 1:6685fde43d21
540 tag: tip
542 tag: tip
541 user: test
543 user: test
542 date: * (glob)
544 date: * (glob)
543 summary: blah
545 summary: blah
544 files:
546 files:
545 M a
547 M a
546 b
548 b
547 R b
549 R b
548
550
549
551
550 $ cd ..
552 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now