comparison tests/test-rewind.t @ 3864:0254c96ce108

rewind: add a test for rewinding a split There are no code change needed but it is worth testing on its own.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 17 Jun 2018 01:36:30 +0200
parents c31be22d1d90
children b945f2dae587
comparison
equal deleted inserted replaced
3863:c31be22d1d90 3864:0254c96ce108
437 o changeset: 0:eba9c2249fe7 437 o changeset: 0:eba9c2249fe7
438 user: test 438 user: test
439 date: Thu Jan 01 00:00:00 1970 +0000 439 date: Thu Jan 01 00:00:00 1970 +0000
440 summary: c_ROOT 440 summary: c_ROOT
441 441
442 $ cd ..
443
444 rewind a simple split
445 ---------------------
446
447 Setup
448 `````
449
450 $ hg clone rewind-testing-base rewind-testing-split-fold
451 updating to branch default
452 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
453 $ cd rewind-testing-split-fold
454
455 $ echo C > C
456 $ echo D > D
457 $ hg add C D
458 $ hg ci -m 'c_CD0'
459 $ hg split << EOF
460 > y
461 > f
462 > d
463 > y
464 > EOF
465 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
466 adding C
467 adding D
468 diff --git a/C b/C
469 new file mode 100644
470 examine changes to 'C'? [Ynesfdaq?] y
471
472 @@ -0,0 +1,1 @@
473 +C
474 record change 1/2 to 'C'? [Ynesfdaq?] f
475
476 diff --git a/D b/D
477 new file mode 100644
478 examine changes to 'D'? [Ynesfdaq?] d
479
480 created new head
481 Done splitting? [yN] y
482 $ hg log -G
483 @ changeset: 5:9576e80d6851
484 | tag: tip
485 | user: test
486 | date: Thu Jan 01 00:00:02 1970 +0000
487 | summary: c_CD0
488 |
489 o changeset: 4:a0316c4c5417
490 | parent: 2:7e594302a05d
491 | user: test
492 | date: Thu Jan 01 00:00:02 1970 +0000
493 | summary: c_CD0
494 |
495 o changeset: 2:7e594302a05d
496 | user: test
497 | date: Thu Jan 01 00:00:00 1970 +0000
498 | summary: c_B0
499 |
500 o changeset: 1:579f120ba918
501 | user: test
502 | date: Thu Jan 01 00:00:00 1970 +0000
503 | summary: c_A0
504 |
505 o changeset: 0:eba9c2249fe7
506 user: test
507 date: Thu Jan 01 00:00:00 1970 +0000
508 summary: c_ROOT
509
510 $ hg debugobsolete
511 49fb7d900906b0a3d329e90da4dcb0a7582d3b6e a0316c4c54179357e71d068fb8884678ebc7c351 9576e80d6851ce79cd535e2dc5fa01b444d89a39 0 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '12', 'operation': 'split', 'user': 'test'}
512 $ hg obslog --all
513 @ 9576e80d6851 (5) c_CD0
514 |
515 | o a0316c4c5417 (4) c_CD0
516 |/
517 x 49fb7d900906 (3) c_CD0
518 rewritten(parent, content) as 9576e80d6851, a0316c4c5417 using split by test (Thu Jan 01 00:00:02 1970 +0000)
519
520
521 Actual rewind
522 `````````````
523
524 $ hg rewind --hidden --to 'min(desc("c_CD0"))'
525 rewinded to 1 changesets
526 (2 changesets obsoleted)
527 working directory is now at 4535d0af405c
528 $ hg debugobsolete
529 49fb7d900906b0a3d329e90da4dcb0a7582d3b6e a0316c4c54179357e71d068fb8884678ebc7c351 9576e80d6851ce79cd535e2dc5fa01b444d89a39 0 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '12', 'operation': 'split', 'user': 'test'}
530 49fb7d900906b0a3d329e90da4dcb0a7582d3b6e 4535d0af405c1bf35f37b35f26ec6f9acfa6fe0b 4 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '2', 'operation': 'rewind', 'user': 'test'}
531 9576e80d6851ce79cd535e2dc5fa01b444d89a39 4535d0af405c1bf35f37b35f26ec6f9acfa6fe0b 0 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '14', 'operation': 'rewind', 'user': 'test'}
532 a0316c4c54179357e71d068fb8884678ebc7c351 4535d0af405c1bf35f37b35f26ec6f9acfa6fe0b 0 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '10', 'operation': 'rewind', 'user': 'test'}
533 $ hg obslog
534 @ 4535d0af405c (6) c_CD0
535 |\
536 | \
537 | |\
538 | x | 9576e80d6851 (5) c_CD0
539 |/ / rewritten(meta, parent, content) as 4535d0af405c using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
540 | |
541 | x a0316c4c5417 (4) c_CD0
542 |/ rewritten(meta, content) as 4535d0af405c using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
543 |
544 x 49fb7d900906 (3) c_CD0
545 rewritten(meta) as 4535d0af405c using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
546 rewritten(parent, content) as 9576e80d6851, a0316c4c5417 using split by test (Thu Jan 01 00:00:02 1970 +0000)
547
548 $ hg log -G
549 @ changeset: 6:4535d0af405c
550 | tag: tip
551 | parent: 2:7e594302a05d
552 | user: test
553 | date: Thu Jan 01 00:00:02 1970 +0000
554 | summary: c_CD0
555 |
556 o changeset: 2:7e594302a05d
557 | user: test
558 | date: Thu Jan 01 00:00:00 1970 +0000
559 | summary: c_B0
560 |
561 o changeset: 1:579f120ba918
562 | user: test
563 | date: Thu Jan 01 00:00:00 1970 +0000
564 | summary: c_A0
565 |
566 o changeset: 0:eba9c2249fe7
567 user: test
568 date: Thu Jan 01 00:00:00 1970 +0000
569 summary: c_ROOT
570