Mercurial > evolve
comparison tests/test-evolve-phase-divergence.t @ 3626:760210aa0d78
tests: add tests of content+parent change creating phase-divergence
This patch adds tests which shows handling of phase divergence cases by `hg
evolve` command which involved content+parent change. The conflicts case is not
handled and will be fixed in upcoming patches.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 23 Mar 2018 18:58:19 +0530 |
parents | 7e253bbac9a1 |
children | 170b99a9c0b4 |
comparison
equal
deleted
inserted
replaced
3625:7e253bbac9a1 | 3626:760210aa0d78 |
---|---|
635 diff -r 502e73736632 -r 2352021b3785 x | 635 diff -r 502e73736632 -r 2352021b3785 x |
636 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | 636 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
637 +++ b/x Thu Jan 01 00:00:00 1970 +0000 | 637 +++ b/x Thu Jan 01 00:00:00 1970 +0000 |
638 @@ -0,0 +1,1 @@ | 638 @@ -0,0 +1,1 @@ |
639 +x | 639 +x |
640 | |
641 Creating divergence with parent and content change both but not resulting in | |
642 conflicts | |
643 ----------------------------------------------------------------------------- | |
644 | |
645 Alice is tired of pushing and pulling and will create phase-divergence locally | |
646 | |
647 $ hg glog | |
648 @ 9:2352021b3785 added x to x | |
649 | (bm) public | |
650 o 8:502e73736632 phase-divergent update to b756eb10ea73: | |
651 | () public | |
652 o 6:b756eb10ea73 added bar to bar | |
653 | () public | |
654 o 5:3d62500c673d phase-divergent update to aa071e5554e3: | |
655 | () public | |
656 o 3:aa071e5554e3 added foo to foo | |
657 | () public | |
658 o 1:4d1169d82e47 modify a | |
659 | () public | |
660 o 0:d3873e73d99e init | |
661 () public | |
662 | |
663 $ echo y > y | |
664 $ echo foobar >> foo | |
665 $ hg add y | |
666 $ hg ci -m "y to y and foobar to foo" | |
667 $ hg rebase -r . -d .^^^ | |
668 rebasing 12:dc88f5aa9bc9 "y to y and foobar to foo" (tip) | |
669 | |
670 $ echo foo > y | |
671 $ hg amend | |
672 | |
673 Alice making the old changeset public to have content-divergence | |
674 | |
675 $ hg phase -r dc88f5aa9bc9 --public --hidden | |
676 1 new phase-divergent changesets | |
677 $ hg glog | |
678 @ 14:13015a180eee y to y and foobar to foo | |
679 | () draft | |
680 | o 12:dc88f5aa9bc9 y to y and foobar to foo | |
681 | | () public | |
682 | o 9:2352021b3785 added x to x | |
683 | | (bm) public | |
684 | o 8:502e73736632 phase-divergent update to b756eb10ea73: | |
685 |/ () public | |
686 o 6:b756eb10ea73 added bar to bar | |
687 | () public | |
688 o 5:3d62500c673d phase-divergent update to aa071e5554e3: | |
689 | () public | |
690 o 3:aa071e5554e3 added foo to foo | |
691 | () public | |
692 o 1:4d1169d82e47 modify a | |
693 | () public | |
694 o 0:d3873e73d99e init | |
695 () public | |
696 | |
697 $ hg obslog -r . | |
698 @ 13015a180eee (14) y to y and foobar to foo | |
699 | | |
700 x 211ab84d1689 (13) y to y and foobar to foo | |
701 | rewritten(content) as 13015a180eee using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
702 | | |
703 o dc88f5aa9bc9 (12) y to y and foobar to foo | |
704 rewritten(parent) as 211ab84d1689 using rebase by test (Thu Jan 01 00:00:00 1970 +0000) | |
705 | |
706 Resolving divergence using `hg evolve` | |
707 ------------------------------------- | |
708 | |
709 $ hg evolve --phase-divergent | |
710 recreate:[14] y to y and foobar to foo | |
711 atop:[12] y to y and foobar to foo | |
712 rebasing to destination parent: 2352021b3785 | |
713 computing new diff | |
714 committed as 8c2bb6fb44e9 | |
715 working directory is now at 8c2bb6fb44e9 | |
716 | |
717 $ hg exp | |
718 # HG changeset patch | |
719 # User test | |
720 # Date 0 0 | |
721 # Thu Jan 01 00:00:00 1970 +0000 | |
722 # Node ID 8c2bb6fb44e9443c64b3a2a3d061272c8e25e6ce | |
723 # Parent dc88f5aa9bc90a6418899d267d9524205dfb429b | |
724 phase-divergent update to dc88f5aa9bc9: | |
725 | |
726 y to y and foobar to foo | |
727 | |
728 diff -r dc88f5aa9bc9 -r 8c2bb6fb44e9 y | |
729 --- a/y Thu Jan 01 00:00:00 1970 +0000 | |
730 +++ b/y Thu Jan 01 00:00:00 1970 +0000 | |
731 @@ -1,1 +1,1 @@ | |
732 -y | |
733 +foo | |
734 | |
735 $ hg glog | |
736 @ 16:8c2bb6fb44e9 phase-divergent update to dc88f5aa9bc9: | |
737 | () draft | |
738 o 12:dc88f5aa9bc9 y to y and foobar to foo | |
739 | () public | |
740 o 9:2352021b3785 added x to x | |
741 | (bm) public | |
742 o 8:502e73736632 phase-divergent update to b756eb10ea73: | |
743 | () public | |
744 o 6:b756eb10ea73 added bar to bar | |
745 | () public | |
746 o 5:3d62500c673d phase-divergent update to aa071e5554e3: | |
747 | () public | |
748 o 3:aa071e5554e3 added foo to foo | |
749 | () public | |
750 o 1:4d1169d82e47 modify a | |
751 | () public | |
752 o 0:d3873e73d99e init | |
753 () public | |
754 | |
755 Creating divergence with parent and content change both which results in | |
756 conflicts while rebasing on parent | |
757 ----------------------------------------------------------------------------- | |
758 | |
759 $ echo l > l | |
760 $ hg ci -Aqm "added l to l" | |
761 $ hg rebase -r . -d .^^^^ | |
762 rebasing 17:f3794e5a91dc "added l to l" (tip) | |
763 $ echo kl > l | |
764 $ echo foo > x | |
765 $ hg add x | |
766 $ hg amend | |
767 | |
768 $ hg obslog -r . | |
769 @ 5fd38c0de46e (19) added l to l | |
770 | | |
771 x 2bfd56949cf0 (18) added l to l | |
772 | rewritten(content) as 5fd38c0de46e using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
773 | | |
774 x f3794e5a91dc (17) added l to l | |
775 rewritten(parent) as 2bfd56949cf0 using rebase by test (Thu Jan 01 00:00:00 1970 +0000) | |
776 | |
777 | |
778 $ hg phase -r f3794e5a91dc --public --hidden | |
779 1 new phase-divergent changesets | |
780 | |
781 Resolution using `hg evolve --phase-divergent` | |
782 ---------------------------------------------- | |
783 | |
784 $ hg evolve --phase-divergent | |
785 recreate:[19] added l to l | |
786 atop:[17] added l to l | |
787 rebasing to destination parent: 8c2bb6fb44e9 | |
788 merging x | |
789 warning: conflicts while merging x! (edit, then use 'hg resolve --mark') | |
790 evolution failed! | |
791 fix conflict and run 'hg evolve --continue' | |
792 abort: unresolved merge conflicts (see hg help resolve) | |
793 [255] | |
794 | |
795 $ hg diff | |
796 diff -r 8c2bb6fb44e9 l | |
797 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
798 +++ b/l Thu Jan 01 00:00:00 1970 +0000 | |
799 @@ -0,0 +1,1 @@ | |
800 +kl | |
801 diff -r 8c2bb6fb44e9 x | |
802 --- a/x Thu Jan 01 00:00:00 1970 +0000 | |
803 +++ b/x Thu Jan 01 00:00:00 1970 +0000 | |
804 @@ -1,1 +1,5 @@ | |
805 +<<<<<<< destination: 8c2bb6fb44e9 - test: phase-divergent update to dc88f5aa9... | |
806 x | |
807 +======= | |
808 +foo | |
809 +>>>>>>> evolving: 5fd38c0de46e - test: added l to l | |
810 | |
811 $ echo foo > x | |
812 | |
813 XXX: we should suggest graft --continue here | |
814 $ hg resolve -m | |
815 (no more unresolved files) | |
816 continue: hg graft --continue | |
817 | |
818 XXX: we should handle this correctly here | |
819 $ hg evolve --continue | |
820 abort: no interrupted evolve to continue | |
821 [255] |