##// END OF EJS Templates
test-mv-cp-st-diff: avoid linkrev collisions...
Alexis S. L. Carvalho -
r6282:709652cd default
parent child Browse files
Show More
@@ -1,63 +1,67 b''
1 1 #!/bin/sh
2 2
3 3 add()
4 4 {
5 5 echo $2 >> $1
6 6 }
7 7
8 8 hg init t
9 9 cd t
10 10
11 11 # set up a boring main branch
12 12 add a a
13 13 hg add a
14 14 hg ci -m0
15 15
16 16 add a m1
17 17 hg ci -m1
18 18
19 19 add a m2
20 20 hg ci -m2
21 21
22 22 show()
23 23 {
24 24 echo "- $2: $1"
25 25 hg st -C $1
26 26 echo
27 27 hg diff --git $1
28 28 echo
29 29 }
30 30
31 count=0
31 32 # make a new branch and get diff/status output
32 33 # $1 - first commit
33 34 # $2 - second commit
34 35 # $3 - working dir action
35 36 # $4 - test description
36 37 tb()
37 38 {
38 39 hg co -q -C 0
39 40
41 add a $count
42 count=`expr $count + 1`
43 hg ci -m "t0"
40 44 $1
41 45 hg ci -m "t1"
42 46 $2
43 47 hg ci -m "t2"
44 48 $3
45 49
46 50 echo "** $4 **"
47 51 echo "** $1 / $2 / $3"
48 52 show "" "working to parent"
49 53 show "--rev 0" "working to root"
50 54 show "--rev 2" "working to branch"
51 55 show "--rev 0 --rev ." "root to parent"
52 56 show "--rev . --rev 0" "parent to root"
53 57 show "--rev 2 --rev ." "branch to parent"
54 58 show "--rev . --rev 2" "parent to branch"
55 59 echo
56 60 }
57 61
58 62 tb "add a a1" "add a a2" "hg mv a b" "rename in working dir"
59 63 tb "add a a1" "add a a2" "hg cp a b" "copy in working dir"
60 64 tb "hg mv a b" "add b b1" "add b w" "single rename"
61 65 tb "hg cp a b" "add b b1" "add a w" "single copy"
62 66 tb "hg mv a b" "hg mv b c" "hg mv c d" "rename chain"
63 67 tb "hg cp a b" "hg cp b c" "hg cp c d" "copy chain"
@@ -1,673 +1,795 b''
1 1 ** rename in working dir **
2 2 ** add a a1 / add a a2 / hg mv a b
3 3 - working to parent:
4 4 A b
5 5 a
6 6 R a
7 7
8 8 diff --git a/a b/b
9 9 rename from a
10 10 rename to b
11 11
12 12 - working to root: --rev 0
13 13 A b
14 14 a
15 15 R a
16 16
17 17 diff --git a/a b/b
18 18 rename from a
19 19 rename to b
20 20 --- a/a
21 21 +++ b/b
22 @@ -1,1 +1,3 @@
22 @@ -1,1 +1,4 @@
23 23 a
24 +0
24 25 +a1
25 26 +a2
26 27
27 28 - working to branch: --rev 2
28 29 A b
29 30 a
30 31 R a
31 32
32 33 diff --git a/a b/b
33 34 rename from a
34 35 rename to b
35 36 --- a/a
36 37 +++ b/b
37 @@ -1,3 +1,3 @@
38 @@ -1,3 +1,4 @@
38 39 a
39 40 -m1
40 41 -m2
42 +0
41 43 +a1
42 44 +a2
43 45
44 46 - root to parent: --rev 0 --rev .
45 47 M a
46 48
47 49 diff --git a/a b/a
48 50 --- a/a
49 51 +++ b/a
50 @@ -1,1 +1,3 @@
52 @@ -1,1 +1,4 @@
51 53 a
54 +0
52 55 +a1
53 56 +a2
54 57
55 58 - parent to root: --rev . --rev 0
56 59 M a
57 60
58 61 diff --git a/a b/a
59 62 --- a/a
60 63 +++ b/a
61 @@ -1,3 +1,1 @@
64 @@ -1,4 +1,1 @@
62 65 a
66 -0
63 67 -a1
64 68 -a2
65 69
66 70 - branch to parent: --rev 2 --rev .
67 71 M a
68 72
69 73 diff --git a/a b/a
70 74 --- a/a
71 75 +++ b/a
72 @@ -1,3 +1,3 @@
76 @@ -1,3 +1,4 @@
73 77 a
74 78 -m1
75 79 -m2
80 +0
76 81 +a1
77 82 +a2
78 83
79 84 - parent to branch: --rev . --rev 2
80 85 M a
81 86
82 87 diff --git a/a b/a
83 88 --- a/a
84 89 +++ b/a
85 @@ -1,3 +1,3 @@
90 @@ -1,4 +1,3 @@
86 91 a
92 -0
87 93 -a1
88 94 -a2
89 95 +m1
90 96 +m2
91 97
92 98
93 99 ** copy in working dir **
94 100 ** add a a1 / add a a2 / hg cp a b
95 101 - working to parent:
96 102 A b
97 103 a
98 104
99 105 diff --git a/a b/b
100 106 copy from a
101 107 copy to b
102 108
103 109 - working to root: --rev 0
104 110 M a
105 111 A b
106 112 a
107 113
108 114 diff --git a/a b/a
109 115 --- a/a
110 116 +++ b/a
111 @@ -1,1 +1,3 @@
117 @@ -1,1 +1,4 @@
112 118 a
119 +1
113 120 +a1
114 121 +a2
115 122 diff --git a/a b/b
116 123 copy from a
117 124 copy to b
118 125 --- a/a
119 126 +++ b/b
120 @@ -1,1 +1,3 @@
127 @@ -1,1 +1,4 @@
121 128 a
129 +1
122 130 +a1
123 131 +a2
124 132
125 133 - working to branch: --rev 2
126 134 M a
127 135 A b
128 136 a
129 137
130 138 diff --git a/a b/a
131 139 --- a/a
132 140 +++ b/a
133 @@ -1,3 +1,3 @@
141 @@ -1,3 +1,4 @@
134 142 a
135 143 -m1
136 144 -m2
145 +1
137 146 +a1
138 147 +a2
139 148 diff --git a/a b/b
140 149 copy from a
141 150 copy to b
142 151 --- a/a
143 152 +++ b/b
144 @@ -1,3 +1,3 @@
153 @@ -1,3 +1,4 @@
145 154 a
146 155 -m1
147 156 -m2
157 +1
148 158 +a1
149 159 +a2
150 160
151 161 - root to parent: --rev 0 --rev .
152 162 M a
153 163
154 164 diff --git a/a b/a
155 165 --- a/a
156 166 +++ b/a
157 @@ -1,1 +1,3 @@
167 @@ -1,1 +1,4 @@
158 168 a
169 +1
159 170 +a1
160 171 +a2
161 172
162 173 - parent to root: --rev . --rev 0
163 174 M a
164 175
165 176 diff --git a/a b/a
166 177 --- a/a
167 178 +++ b/a
168 @@ -1,3 +1,1 @@
179 @@ -1,4 +1,1 @@
169 180 a
181 -1
170 182 -a1
171 183 -a2
172 184
173 185 - branch to parent: --rev 2 --rev .
174 186 M a
175 187
176 188 diff --git a/a b/a
177 189 --- a/a
178 190 +++ b/a
179 @@ -1,3 +1,3 @@
191 @@ -1,3 +1,4 @@
180 192 a
181 193 -m1
182 194 -m2
195 +1
183 196 +a1
184 197 +a2
185 198
186 199 - parent to branch: --rev . --rev 2
187 200 M a
188 201
189 202 diff --git a/a b/a
190 203 --- a/a
191 204 +++ b/a
192 @@ -1,3 +1,3 @@
205 @@ -1,4 +1,3 @@
193 206 a
207 -1
194 208 -a1
195 209 -a2
196 210 +m1
197 211 +m2
198 212
199 213
200 214 ** single rename **
201 215 ** hg mv a b / add b b1 / add b w
202 216 - working to parent:
203 217 M b
204 218
205 219 diff --git a/b b/b
206 220 --- a/b
207 221 +++ b/b
208 @@ -1,2 +1,3 @@
222 @@ -1,3 +1,4 @@
209 223 a
224 2
210 225 b1
211 226 +w
212 227
213 228 - working to root: --rev 0
214 229 A b
215 230 a
216 231 R a
217 232
218 233 diff --git a/a b/b
219 234 rename from a
220 235 rename to b
221 236 --- a/a
222 237 +++ b/b
223 @@ -1,1 +1,3 @@
238 @@ -1,1 +1,4 @@
224 239 a
240 +2
225 241 +b1
226 242 +w
227 243
228 244 - working to branch: --rev 2
229 245 A b
230 246 a
231 247 R a
232 248
233 249 diff --git a/a b/b
234 250 rename from a
235 251 rename to b
236 252 --- a/a
237 253 +++ b/b
238 @@ -1,3 +1,3 @@
254 @@ -1,3 +1,4 @@
239 255 a
240 256 -m1
241 257 -m2
258 +2
242 259 +b1
243 260 +w
244 261
245 262 - root to parent: --rev 0 --rev .
246 263 A b
247 264 a
248 265 R a
249 266
250 267 diff --git a/a b/b
251 268 rename from a
252 269 rename to b
253 270 --- a/a
254 271 +++ b/b
255 @@ -1,1 +1,2 @@
272 @@ -1,1 +1,3 @@
256 273 a
274 +2
257 275 +b1
258 276
259 277 - parent to root: --rev . --rev 0
260 278 A a
261 279 b
262 280 R b
263 281
264 282 diff --git a/b b/a
265 283 rename from b
266 284 rename to a
267 285 --- a/b
268 286 +++ b/a
269 @@ -1,2 +1,1 @@
287 @@ -1,3 +1,1 @@
270 288 a
289 -2
271 290 -b1
272 291
273 292 - branch to parent: --rev 2 --rev .
274 293 A b
275 294 a
276 295 R a
277 296
278 297 diff --git a/a b/b
279 298 rename from a
280 299 rename to b
281 300 --- a/a
282 301 +++ b/b
283 @@ -1,3 +1,2 @@
302 @@ -1,3 +1,3 @@
284 303 a
285 304 -m1
286 305 -m2
306 +2
287 307 +b1
288 308
289 309 - parent to branch: --rev . --rev 2
290 310 A a
291 311 b
292 312 R b
293 313
294 314 diff --git a/b b/a
295 315 rename from b
296 316 rename to a
297 317 --- a/b
298 318 +++ b/a
299 @@ -1,2 +1,3 @@
319 @@ -1,3 +1,3 @@
300 320 a
321 -2
301 322 -b1
302 323 +m1
303 324 +m2
304 325
305 326
306 327 ** single copy **
307 328 ** hg cp a b / add b b1 / add a w
308 329 - working to parent:
309 330 M a
310 331
311 332 diff --git a/a b/a
312 333 --- a/a
313 334 +++ b/a
314 @@ -1,1 +1,2 @@
335 @@ -1,2 +1,3 @@
315 336 a
337 3
316 338 +w
317 339
318 340 - working to root: --rev 0
319 341 M a
320 342 A b
321 343 a
322 344
323 345 diff --git a/a b/a
324 346 --- a/a
325 347 +++ b/a
326 @@ -1,1 +1,2 @@
348 @@ -1,1 +1,3 @@
349 a
350 +3
351 +w
352 diff --git a/a b/b
353 copy from a
354 copy to b
355 --- a/a
356 +++ b/b
357 @@ -1,1 +1,3 @@
327 358 a
359 +3
360 +b1
361
362 - working to branch: --rev 2
363 M a
364 A b
365 a
366
367 diff --git a/a b/a
368 --- a/a
369 +++ b/a
370 @@ -1,3 +1,3 @@
371 a
372 -m1
373 -m2
374 +3
328 375 +w
329 376 diff --git a/a b/b
330 377 copy from a
331 378 copy to b
332 379 --- a/a
333 380 +++ b/b
381 @@ -1,3 +1,3 @@
382 a
383 -m1
384 -m2
385 +3
386 +b1
387
388 - root to parent: --rev 0 --rev .
389 M a
390 A b
391 a
392
393 diff --git a/a b/a
394 --- a/a
395 +++ b/a
334 396 @@ -1,1 +1,2 @@
335 397 a
398 +3
399 diff --git a/a b/b
400 copy from a
401 copy to b
402 --- a/a
403 +++ b/b
404 @@ -1,1 +1,3 @@
405 a
406 +3
336 407 +b1
337 408
338 - working to branch: --rev 2
409 - parent to root: --rev . --rev 0
410 M a
411 R b
412
413 diff --git a/a b/a
414 --- a/a
415 +++ b/a
416 @@ -1,2 +1,1 @@
417 a
418 -3
419 diff --git a/b b/b
420 deleted file mode 100644
421 --- a/b
422 +++ /dev/null
423 @@ -1,3 +0,0 @@
424 -a
425 -3
426 -b1
427
428 - branch to parent: --rev 2 --rev .
339 429 M a
340 430 A b
341 431 a
342 432
343 433 diff --git a/a b/a
344 434 --- a/a
345 435 +++ b/a
346 436 @@ -1,3 +1,2 @@
347 437 a
348 438 -m1
349 439 -m2
350 +w
351 diff --git a/a b/b
352 copy from a
353 copy to b
354 --- a/a
355 +++ b/b
356 @@ -1,3 +1,2 @@
357 a
358 -m1
359 -m2
360 +b1
361
362 - root to parent: --rev 0 --rev .
363 A b
364 a
365
440 +3
366 441 diff --git a/a b/b
367 442 copy from a
368 443 copy to b
369 444 --- a/a
370 445 +++ b/b
371 @@ -1,1 +1,2 @@
372 a
373 +b1
374
375 - parent to root: --rev . --rev 0
376 R b
377
378 diff --git a/b b/b
379 deleted file mode 100644
380 --- a/b
381 +++ /dev/null
382 @@ -1,2 +0,0 @@
383 -a
384 -b1
385
386 - branch to parent: --rev 2 --rev .
387 M a
388 A b
389 a
390
391 diff --git a/a b/a
392 --- a/a
393 +++ b/a
394 @@ -1,3 +1,1 @@
446 @@ -1,3 +1,3 @@
395 447 a
396 448 -m1
397 449 -m2
398 diff --git a/a b/b
399 copy from a
400 copy to b
401 --- a/a
402 +++ b/b
403 @@ -1,3 +1,2 @@
404 a
405 -m1
406 -m2
450 +3
407 451 +b1
408 452
409 453 - parent to branch: --rev . --rev 2
410 454 M a
411 455 R b
412 456
413 457 diff --git a/a b/a
414 458 --- a/a
415 459 +++ b/a
416 @@ -1,1 +1,3 @@
460 @@ -1,2 +1,3 @@
417 461 a
462 -3
418 463 +m1
419 464 +m2
420 465 diff --git a/b b/b
421 466 deleted file mode 100644
422 467 --- a/b
423 468 +++ /dev/null
424 @@ -1,2 +0,0 @@
469 @@ -1,3 +0,0 @@
425 470 -a
471 -3
426 472 -b1
427 473
428 474
429 475 ** rename chain **
430 476 ** hg mv a b / hg mv b c / hg mv c d
431 477 - working to parent:
432 478 A d
433 479 c
434 480 R c
435 481
436 482 diff --git a/c b/d
437 483 rename from c
438 484 rename to d
439 485
440 486 - working to root: --rev 0
441 487 A d
442 488 a
443 489 R a
444 490
445 491 diff --git a/a b/d
446 492 rename from a
447 493 rename to d
494 --- a/a
495 +++ b/d
496 @@ -1,1 +1,2 @@
497 a
498 +4
448 499
449 500 - working to branch: --rev 2
450 501 A d
451 502 a
452 503 R a
453 504
454 505 diff --git a/a b/d
455 506 rename from a
456 507 rename to d
457 508 --- a/a
458 509 +++ b/d
459 @@ -1,3 +1,1 @@
510 @@ -1,3 +1,2 @@
460 511 a
461 512 -m1
462 513 -m2
514 +4
463 515
464 516 - root to parent: --rev 0 --rev .
465 517 A c
466 518 a
467 519 R a
468 520
469 521 diff --git a/a b/c
470 522 rename from a
471 523 rename to c
524 --- a/a
525 +++ b/c
526 @@ -1,1 +1,2 @@
527 a
528 +4
472 529
473 530 - parent to root: --rev . --rev 0
474 531 A a
475 532 c
476 533 R c
477 534
478 535 diff --git a/c b/a
479 536 rename from c
480 537 rename to a
538 --- a/c
539 +++ b/a
540 @@ -1,2 +1,1 @@
541 a
542 -4
481 543
482 544 - branch to parent: --rev 2 --rev .
483 545 A c
484 546 a
485 547 R a
486 548
487 549 diff --git a/a b/c
488 550 rename from a
489 551 rename to c
490 552 --- a/a
491 553 +++ b/c
492 @@ -1,3 +1,1 @@
554 @@ -1,3 +1,2 @@
493 555 a
494 556 -m1
495 557 -m2
558 +4
496 559
497 560 - parent to branch: --rev . --rev 2
498 561 A a
499 562 c
500 563 R c
501 564
502 565 diff --git a/c b/a
503 566 rename from c
504 567 rename to a
505 568 --- a/c
506 569 +++ b/a
507 @@ -1,1 +1,3 @@
570 @@ -1,2 +1,3 @@
508 571 a
572 -4
509 573 +m1
510 574 +m2
511 575
512 576
513 577 ** copy chain **
514 578 ** hg cp a b / hg cp b c / hg cp c d
515 579 - working to parent:
516 580 A d
517 581 c
518 582
519 583 diff --git a/c b/d
520 584 copy from c
521 585 copy to d
522 586
523 587 - working to root: --rev 0
588 M a
524 589 A b
525 590 a
526 591 A c
527 592 a
528 593 A d
529 594 a
530 595
596 diff --git a/a b/a
597 --- a/a
598 +++ b/a
599 @@ -1,1 +1,2 @@
600 a
601 +5
531 602 diff --git a/a b/b
532 603 copy from a
533 604 copy to b
605 --- a/a
606 +++ b/b
607 @@ -1,1 +1,2 @@
608 a
609 +5
534 610 diff --git a/a b/c
535 611 copy from a
536 612 copy to c
613 --- a/a
614 +++ b/c
615 @@ -1,1 +1,2 @@
616 a
617 +5
537 618 diff --git a/a b/d
538 619 copy from a
539 620 copy to d
621 --- a/a
622 +++ b/d
623 @@ -1,1 +1,2 @@
624 a
625 +5
540 626
541 627 - working to branch: --rev 2
542 628 M a
543 629 A b
544 630 a
545 631 A c
546 632 a
547 633 A d
548 634 a
549 635
550 636 diff --git a/a b/a
551 637 --- a/a
552 638 +++ b/a
553 @@ -1,3 +1,1 @@
639 @@ -1,3 +1,2 @@
554 640 a
555 641 -m1
556 642 -m2
643 +5
557 644 diff --git a/a b/b
558 645 copy from a
559 646 copy to b
560 647 --- a/a
561 648 +++ b/b
562 @@ -1,3 +1,1 @@
649 @@ -1,3 +1,2 @@
563 650 a
564 651 -m1
565 652 -m2
653 +5
566 654 diff --git a/a b/c
567 655 copy from a
568 656 copy to c
569 657 --- a/a
570 658 +++ b/c
571 @@ -1,3 +1,1 @@
659 @@ -1,3 +1,2 @@
572 660 a
573 661 -m1
574 662 -m2
663 +5
575 664 diff --git a/a b/d
576 665 copy from a
577 666 copy to d
578 667 --- a/a
579 668 +++ b/d
580 @@ -1,3 +1,1 @@
669 @@ -1,3 +1,2 @@
581 670 a
582 671 -m1
583 672 -m2
673 +5
584 674
585 675 - root to parent: --rev 0 --rev .
676 M a
586 677 A b
587 678 a
588 679 A c
589 680 a
590 681
682 diff --git a/a b/a
683 --- a/a
684 +++ b/a
685 @@ -1,1 +1,2 @@
686 a
687 +5
591 688 diff --git a/a b/b
592 689 copy from a
593 690 copy to b
691 --- a/a
692 +++ b/b
693 @@ -1,1 +1,2 @@
694 a
695 +5
594 696 diff --git a/a b/c
595 697 copy from a
596 698 copy to c
699 --- a/a
700 +++ b/c
701 @@ -1,1 +1,2 @@
702 a
703 +5
597 704
598 705 - parent to root: --rev . --rev 0
706 M a
599 707 R b
600 708 R c
601 709
710 diff --git a/a b/a
711 --- a/a
712 +++ b/a
713 @@ -1,2 +1,1 @@
714 a
715 -5
602 716 diff --git a/b b/b
603 717 deleted file mode 100644
604 718 --- a/b
605 719 +++ /dev/null
606 @@ -1,1 +0,0 @@
720 @@ -1,2 +0,0 @@
607 721 -a
722 -5
608 723 diff --git a/c b/c
609 724 deleted file mode 100644
610 725 --- a/c
611 726 +++ /dev/null
612 @@ -1,1 +0,0 @@
727 @@ -1,2 +0,0 @@
613 728 -a
729 -5
614 730
615 731 - branch to parent: --rev 2 --rev .
616 732 M a
617 733 A b
618 734 a
619 735 A c
620 736 a
621 737
622 738 diff --git a/a b/a
623 739 --- a/a
624 740 +++ b/a
625 @@ -1,3 +1,1 @@
741 @@ -1,3 +1,2 @@
626 742 a
627 743 -m1
628 744 -m2
745 +5
629 746 diff --git a/a b/b
630 747 copy from a
631 748 copy to b
632 749 --- a/a
633 750 +++ b/b
634 @@ -1,3 +1,1 @@
751 @@ -1,3 +1,2 @@
635 752 a
636 753 -m1
637 754 -m2
755 +5
638 756 diff --git a/a b/c
639 757 copy from a
640 758 copy to c
641 759 --- a/a
642 760 +++ b/c
643 @@ -1,3 +1,1 @@
761 @@ -1,3 +1,2 @@
644 762 a
645 763 -m1
646 764 -m2
765 +5
647 766
648 767 - parent to branch: --rev . --rev 2
649 768 M a
650 769 R b
651 770 R c
652 771
653 772 diff --git a/a b/a
654 773 --- a/a
655 774 +++ b/a
656 @@ -1,1 +1,3 @@
775 @@ -1,2 +1,3 @@
657 776 a
777 -5
658 778 +m1
659 779 +m2
660 780 diff --git a/b b/b
661 781 deleted file mode 100644
662 782 --- a/b
663 783 +++ /dev/null
664 @@ -1,1 +0,0 @@
784 @@ -1,2 +0,0 @@
665 785 -a
786 -5
666 787 diff --git a/c b/c
667 788 deleted file mode 100644
668 789 --- a/c
669 790 +++ /dev/null
670 @@ -1,1 +0,0 @@
791 @@ -1,2 +0,0 @@
671 792 -a
793 -5
672 794
673 795
General Comments 0
You need to be logged in to leave comments. Login now