Mercurial > hg-stable
comparison tests/test-rename.t @ 15447:9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Globbing is usually used for filenames, so on windows it is reasonable and very
convenient that glob patterns accepts '\' or '/' when the pattern specifies
'/'.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Mon, 07 Nov 2011 03:25:10 +0100 |
parents | e0348815e806 |
children | 7f1cec2f63ab |
comparison
equal
deleted
inserted
replaced
15446:c5c9ca3719f9 | 15447:9910f60a37ee |
---|---|
69 $ rm d2/c | 69 $ rm d2/c |
70 | 70 |
71 rename --after a single file to a nonexistant target filename | 71 rename --after a single file to a nonexistant target filename |
72 | 72 |
73 $ hg rename --after d1/a dummy | 73 $ hg rename --after d1/a dummy |
74 d1/a: not recording move - dummy does not exist | 74 d1/a: not recording move - dummy does not exist (glob) |
75 | 75 |
76 move a single file to an existing directory | 76 move a single file to an existing directory |
77 | 77 |
78 $ hg rename d1/d11/a1 d2 | 78 $ hg rename d1/d11/a1 d2 |
79 $ hg status -C | 79 $ hg status -C |
119 $ rm d1/d11/e | 119 $ rm d1/d11/e |
120 | 120 |
121 rename directory d1 as d3 | 121 rename directory d1 as d3 |
122 | 122 |
123 $ hg rename d1/ d3 | 123 $ hg rename d1/ d3 |
124 moving d1/a to d3/a | 124 moving d1/a to d3/a (glob) |
125 moving d1/b to d3/b | 125 moving d1/b to d3/b (glob) |
126 moving d1/ba to d3/ba | 126 moving d1/ba to d3/ba (glob) |
127 moving d1/d11/a1 to d3/d11/a1 | 127 moving d1/d11/a1 to d3/d11/a1 (glob) |
128 $ hg status -C | 128 $ hg status -C |
129 A d3/a | 129 A d3/a |
130 d1/a | 130 d1/a |
131 A d3/b | 131 A d3/b |
132 d1/b | 132 d1/b |
144 | 144 |
145 rename --after directory d1 as d3 | 145 rename --after directory d1 as d3 |
146 | 146 |
147 $ mv d1 d3 | 147 $ mv d1 d3 |
148 $ hg rename --after d1 d3 | 148 $ hg rename --after d1 d3 |
149 moving d1/a to d3/a | 149 moving d1/a to d3/a (glob) |
150 moving d1/b to d3/b | 150 moving d1/b to d3/b (glob) |
151 moving d1/ba to d3/ba | 151 moving d1/ba to d3/ba (glob) |
152 moving d1/d11/a1 to d3/d11/a1 | 152 moving d1/d11/a1 to d3/d11/a1 (glob) |
153 $ hg status -C | 153 $ hg status -C |
154 A d3/a | 154 A d3/a |
155 d1/a | 155 d1/a |
156 A d3/b | 156 A d3/b |
157 d1/b | 157 d1/b |
168 $ rm -rf d3 | 168 $ rm -rf d3 |
169 | 169 |
170 move a directory using a relative path | 170 move a directory using a relative path |
171 | 171 |
172 $ (cd d2; mkdir d3; hg rename ../d1/d11 d3) | 172 $ (cd d2; mkdir d3; hg rename ../d1/d11 d3) |
173 moving ../d1/d11/a1 to d3/d11/a1 | 173 moving ../d1/d11/a1 to d3/d11/a1 (glob) |
174 $ hg status -C | 174 $ hg status -C |
175 A d2/d3/d11/a1 | 175 A d2/d3/d11/a1 |
176 d1/d11/a1 | 176 d1/d11/a1 |
177 R d1/d11/a1 | 177 R d1/d11/a1 |
178 $ hg update -C | 178 $ hg update -C |
180 $ rm -rf d2/d3 | 180 $ rm -rf d2/d3 |
181 | 181 |
182 move --after a directory using a relative path | 182 move --after a directory using a relative path |
183 | 183 |
184 $ (cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3) | 184 $ (cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3) |
185 moving ../d1/d11/a1 to d3/d11/a1 | 185 moving ../d1/d11/a1 to d3/d11/a1 (glob) |
186 $ hg status -C | 186 $ hg status -C |
187 A d2/d3/d11/a1 | 187 A d2/d3/d11/a1 |
188 d1/d11/a1 | 188 d1/d11/a1 |
189 R d1/d11/a1 | 189 R d1/d11/a1 |
190 $ hg update -C | 190 $ hg update -C |
192 $ rm -rf d2/d3 | 192 $ rm -rf d2/d3 |
193 | 193 |
194 move directory d1/d11 to an existing directory d2 (removes empty d1) | 194 move directory d1/d11 to an existing directory d2 (removes empty d1) |
195 | 195 |
196 $ hg rename d1/d11/ d2 | 196 $ hg rename d1/d11/ d2 |
197 moving d1/d11/a1 to d2/d11/a1 | 197 moving d1/d11/a1 to d2/d11/a1 (glob) |
198 $ hg status -C | 198 $ hg status -C |
199 A d2/d11/a1 | 199 A d2/d11/a1 |
200 d1/d11/a1 | 200 d1/d11/a1 |
201 R d1/d11/a1 | 201 R d1/d11/a1 |
202 $ hg update -C | 202 $ hg update -C |
205 | 205 |
206 move directories d1 and d2 to a new directory d3 | 206 move directories d1 and d2 to a new directory d3 |
207 | 207 |
208 $ mkdir d3 | 208 $ mkdir d3 |
209 $ hg rename d1 d2 d3 | 209 $ hg rename d1 d2 d3 |
210 moving d1/a to d3/d1/a | 210 moving d1/a to d3/d1/a (glob) |
211 moving d1/b to d3/d1/b | 211 moving d1/b to d3/d1/b (glob) |
212 moving d1/ba to d3/d1/ba | 212 moving d1/ba to d3/d1/ba (glob) |
213 moving d1/d11/a1 to d3/d1/d11/a1 | 213 moving d1/d11/a1 to d3/d1/d11/a1 (glob) |
214 moving d2/b to d3/d2/b | 214 moving d2/b to d3/d2/b (glob) |
215 $ hg status -C | 215 $ hg status -C |
216 A d3/d1/a | 216 A d3/d1/a |
217 d1/a | 217 d1/a |
218 A d3/d1/b | 218 A d3/d1/b |
219 d1/b | 219 d1/b |
235 move --after directories d1 and d2 to a new directory d3 | 235 move --after directories d1 and d2 to a new directory d3 |
236 | 236 |
237 $ mkdir d3 | 237 $ mkdir d3 |
238 $ mv d1 d2 d3 | 238 $ mv d1 d2 d3 |
239 $ hg rename --after d1 d2 d3 | 239 $ hg rename --after d1 d2 d3 |
240 moving d1/a to d3/d1/a | 240 moving d1/a to d3/d1/a (glob) |
241 moving d1/b to d3/d1/b | 241 moving d1/b to d3/d1/b (glob) |
242 moving d1/ba to d3/d1/ba | 242 moving d1/ba to d3/d1/ba (glob) |
243 moving d1/d11/a1 to d3/d1/d11/a1 | 243 moving d1/d11/a1 to d3/d1/d11/a1 (glob) |
244 moving d2/b to d3/d2/b | 244 moving d2/b to d3/d2/b (glob) |
245 $ hg status -C | 245 $ hg status -C |
246 A d3/d1/a | 246 A d3/d1/a |
247 d1/a | 247 d1/a |
248 A d3/d1/b | 248 A d3/d1/b |
249 d1/b | 249 d1/b |
265 move everything under directory d1 to existing directory d2, do not | 265 move everything under directory d1 to existing directory d2, do not |
266 overwrite existing files (d2/b) | 266 overwrite existing files (d2/b) |
267 | 267 |
268 $ hg rename d1/* d2 | 268 $ hg rename d1/* d2 |
269 d2/b: not overwriting - file exists | 269 d2/b: not overwriting - file exists |
270 moving d1/d11/a1 to d2/d11/a1 | 270 moving d1/d11/a1 to d2/d11/a1 (glob) |
271 $ hg status -C | 271 $ hg status -C |
272 A d2/a | 272 A d2/a |
273 d1/a | 273 d1/a |
274 A d2/ba | 274 A d2/ba |
275 d1/ba | 275 d1/ba |
306 | 306 |
307 move every file under d1 to d2/d21 (glob) | 307 move every file under d1 to d2/d21 (glob) |
308 | 308 |
309 $ mkdir d2/d21 | 309 $ mkdir d2/d21 |
310 $ hg rename 'glob:d1/**' d2/d21 | 310 $ hg rename 'glob:d1/**' d2/d21 |
311 moving d1/a to d2/d21/a | 311 moving d1/a to d2/d21/a (glob) |
312 moving d1/b to d2/d21/b | 312 moving d1/b to d2/d21/b (glob) |
313 moving d1/ba to d2/d21/ba | 313 moving d1/ba to d2/d21/ba (glob) |
314 moving d1/d11/a1 to d2/d21/a1 | 314 moving d1/d11/a1 to d2/d21/a1 (glob) |
315 $ hg status -C | 315 $ hg status -C |
316 A d2/d21/a | 316 A d2/d21/a |
317 d1/a | 317 d1/a |
318 A d2/d21/a1 | 318 A d2/d21/a1 |
319 d1/d11/a1 | 319 d1/d11/a1 |
332 move --after some files under d1 to d2/d21 (glob) | 332 move --after some files under d1 to d2/d21 (glob) |
333 | 333 |
334 $ mkdir d2/d21 | 334 $ mkdir d2/d21 |
335 $ mv d1/a d1/d11/a1 d2/d21 | 335 $ mv d1/a d1/d11/a1 d2/d21 |
336 $ hg rename --after 'glob:d1/**' d2/d21 | 336 $ hg rename --after 'glob:d1/**' d2/d21 |
337 moving d1/a to d2/d21/a | 337 moving d1/a to d2/d21/a (glob) |
338 d1/b: not recording move - d2/d21/b does not exist | 338 d1/b: not recording move - d2/d21/b does not exist (glob) |
339 d1/ba: not recording move - d2/d21/ba does not exist | 339 d1/ba: not recording move - d2/d21/ba does not exist (glob) |
340 moving d1/d11/a1 to d2/d21/a1 | 340 moving d1/d11/a1 to d2/d21/a1 (glob) |
341 $ hg status -C | 341 $ hg status -C |
342 A d2/d21/a | 342 A d2/d21/a |
343 d1/a | 343 d1/a |
344 A d2/d21/a1 | 344 A d2/d21/a1 |
345 d1/d11/a1 | 345 d1/d11/a1 |
351 | 351 |
352 move every file under d1 starting with an 'a' to d2/d21 (regexp) | 352 move every file under d1 starting with an 'a' to d2/d21 (regexp) |
353 | 353 |
354 $ mkdir d2/d21 | 354 $ mkdir d2/d21 |
355 $ hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21 | 355 $ hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21 |
356 moving d1/a to d2/d21/a | 356 moving d1/a to d2/d21/a (glob) |
357 moving d1/d11/a1 to d2/d21/a1 | 357 moving d1/d11/a1 to d2/d21/a1 (glob) |
358 $ hg status -C | 358 $ hg status -C |
359 A d2/d21/a | 359 A d2/d21/a |
360 d1/a | 360 d1/a |
361 A d2/d21/a1 | 361 A d2/d21/a1 |
362 d1/d11/a1 | 362 d1/d11/a1 |
413 | 413 |
414 do not copy more than one source file to the same destination file | 414 do not copy more than one source file to the same destination file |
415 | 415 |
416 $ mkdir d3 | 416 $ mkdir d3 |
417 $ hg rename d1/* d2/* d3 | 417 $ hg rename d1/* d2/* d3 |
418 moving d1/d11/a1 to d3/d11/a1 | 418 moving d1/d11/a1 to d3/d11/a1 (glob) |
419 d3/b: not overwriting - d2/b collides with d1/b | 419 d3/b: not overwriting - d2/b collides with d1/b |
420 $ hg status -C | 420 $ hg status -C |
421 A d3/a | 421 A d3/a |
422 d1/a | 422 d1/a |
423 A d3/b | 423 A d3/b |
439 $ mkdir d3 | 439 $ mkdir d3 |
440 $ (cd d1; hg rename . ../d3) | 440 $ (cd d1; hg rename . ../d3) |
441 moving a to ../d3/d1/a | 441 moving a to ../d3/d1/a |
442 moving b to ../d3/d1/b | 442 moving b to ../d3/d1/b |
443 moving ba to ../d3/d1/ba | 443 moving ba to ../d3/d1/ba |
444 moving d11/a1 to ../d3/d1/d11/a1 | 444 moving d11/a1 to ../d3/d1/d11/a1 (glob) |
445 $ hg status -C | 445 $ hg status -C |
446 A d3/d1/a | 446 A d3/d1/a |
447 d1/a | 447 d1/a |
448 A d3/d1/b | 448 A d3/d1/b |
449 d1/b | 449 d1/b |
465 $ mv d1/* d3 | 465 $ mv d1/* d3 |
466 $ (cd d1; hg rename --after . ../d3) | 466 $ (cd d1; hg rename --after . ../d3) |
467 moving a to ../d3/a | 467 moving a to ../d3/a |
468 moving b to ../d3/b | 468 moving b to ../d3/b |
469 moving ba to ../d3/ba | 469 moving ba to ../d3/ba |
470 moving d11/a1 to ../d3/d11/a1 | 470 moving d11/a1 to ../d3/d11/a1 (glob) |
471 $ hg status -C | 471 $ hg status -C |
472 A d3/a | 472 A d3/a |
473 d1/a | 473 d1/a |
474 A d3/b | 474 A d3/b |
475 d1/b | 475 d1/b |
486 $ rm -rf d3 | 486 $ rm -rf d3 |
487 | 487 |
488 move the parent tree with "hg rename .." | 488 move the parent tree with "hg rename .." |
489 | 489 |
490 $ (cd d1/d11; hg rename .. ../../d3) | 490 $ (cd d1/d11; hg rename .. ../../d3) |
491 moving ../a to ../../d3/a | 491 moving ../a to ../../d3/a (glob) |
492 moving ../b to ../../d3/b | 492 moving ../b to ../../d3/b (glob) |
493 moving ../ba to ../../d3/ba | 493 moving ../ba to ../../d3/ba (glob) |
494 moving a1 to ../../d3/d11/a1 | 494 moving a1 to ../../d3/d11/a1 |
495 $ hg status -C | 495 $ hg status -C |
496 A d3/a | 496 A d3/a |
497 d1/a | 497 d1/a |
498 A d3/b | 498 A d3/b |
511 | 511 |
512 skip removed files | 512 skip removed files |
513 | 513 |
514 $ hg remove d1/b | 514 $ hg remove d1/b |
515 $ hg rename d1 d3 | 515 $ hg rename d1 d3 |
516 moving d1/a to d3/a | 516 moving d1/a to d3/a (glob) |
517 moving d1/ba to d3/ba | 517 moving d1/ba to d3/ba (glob) |
518 moving d1/d11/a1 to d3/d11/a1 | 518 moving d1/d11/a1 to d3/d11/a1 (glob) |
519 $ hg status -C | 519 $ hg status -C |
520 A d3/a | 520 A d3/a |
521 d1/a | 521 d1/a |
522 A d3/ba | 522 A d3/ba |
523 d1/ba | 523 d1/ba |
587 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | 587 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
588 | 588 |
589 check illegal path components | 589 check illegal path components |
590 | 590 |
591 $ hg rename d1/d11/a1 .hg/foo | 591 $ hg rename d1/d11/a1 .hg/foo |
592 abort: path contains illegal component: .hg/foo | 592 abort: path contains illegal component: .hg/foo (glob) |
593 [255] | 593 [255] |
594 $ hg status -C | 594 $ hg status -C |
595 $ hg rename d1/d11/a1 ../foo | 595 $ hg rename d1/d11/a1 ../foo |
596 abort: ../foo not under root | 596 abort: ../foo not under root |
597 [255] | 597 [255] |
598 $ hg status -C | 598 $ hg status -C |
599 | 599 |
600 $ mv d1/d11/a1 .hg/foo | 600 $ mv d1/d11/a1 .hg/foo |
601 $ hg rename --after d1/d11/a1 .hg/foo | 601 $ hg rename --after d1/d11/a1 .hg/foo |
602 abort: path contains illegal component: .hg/foo | 602 abort: path contains illegal component: .hg/foo (glob) |
603 [255] | 603 [255] |
604 $ hg status -C | 604 $ hg status -C |
605 ! d1/d11/a1 | 605 ! d1/d11/a1 |
606 $ hg update -C | 606 $ hg update -C |
607 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 607 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
608 $ rm .hg/foo | 608 $ rm .hg/foo |
609 | 609 |
610 $ hg rename d1/d11/a1 .hg | 610 $ hg rename d1/d11/a1 .hg |
611 abort: path contains illegal component: .hg/a1 | 611 abort: path contains illegal component: .hg/a1 (glob) |
612 [255] | 612 [255] |
613 $ hg status -C | 613 $ hg status -C |
614 $ hg rename d1/d11/a1 .. | 614 $ hg rename d1/d11/a1 .. |
615 abort: ../a1 not under root | 615 abort: ../a1 not under root (glob) |
616 [255] | 616 [255] |
617 $ hg status -C | 617 $ hg status -C |
618 | 618 |
619 $ mv d1/d11/a1 .hg | 619 $ mv d1/d11/a1 .hg |
620 $ hg rename --after d1/d11/a1 .hg | 620 $ hg rename --after d1/d11/a1 .hg |
621 abort: path contains illegal component: .hg/a1 | 621 abort: path contains illegal component: .hg/a1 (glob) |
622 [255] | 622 [255] |
623 $ hg status -C | 623 $ hg status -C |
624 ! d1/d11/a1 | 624 ! d1/d11/a1 |
625 $ hg update -C | 625 $ hg update -C |
626 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 626 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
627 $ rm .hg/a1 | 627 $ rm .hg/a1 |
628 | 628 |
629 $ (cd d1/d11; hg rename ../../d2/b ../../.hg/foo) | 629 $ (cd d1/d11; hg rename ../../d2/b ../../.hg/foo) |
630 abort: path contains illegal component: .hg/foo | 630 abort: path contains illegal component: .hg/foo (glob) |
631 [255] | 631 [255] |
632 $ hg status -C | 632 $ hg status -C |
633 $ (cd d1/d11; hg rename ../../d2/b ../../../foo) | 633 $ (cd d1/d11; hg rename ../../d2/b ../../../foo) |
634 abort: ../../../foo not under root | 634 abort: ../../../foo not under root |
635 [255] | 635 [255] |