comparison tests/test-evolve-content-divergence.t @ 3844:48fbccfd1dff

tests: add test of resolution of content-divergent stacks This patch adds a test of resolution of content-divergence stacks where a series of changesets get mutated as two different series resulting in whole content-divergent stacks. As the tests shows, we are not processing the changesets in right order which needs to be fixed first.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 12 Jun 2018 21:13:02 +0530
parents b293cce4ff55
children 5c964ebe4d4b
comparison
equal deleted inserted replaced
3843:f0096db2a7b1 3844:48fbccfd1dff
2 ==================================================================== 2 ====================================================================
3 3
4 $ cat >> $HGRCPATH <<EOF 4 $ cat >> $HGRCPATH <<EOF
5 > [alias] 5 > [alias]
6 > glog = log -GT "{rev}:{node|short} {desc|firstline}\n ({bookmarks}) [{branch}] {phase}" 6 > glog = log -GT "{rev}:{node|short} {desc|firstline}\n ({bookmarks}) [{branch}] {phase}"
7 > [phases]
8 > publish = False
7 > [extensions] 9 > [extensions]
8 > rebase = 10 > rebase =
9 > EOF 11 > EOF
10 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH 12 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
11 13
730 diff -r bbaca013758a -r a15eb4e32166 z 732 diff -r bbaca013758a -r a15eb4e32166 z
731 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 733 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
732 +++ b/z Thu Jan 01 00:00:00 1970 +0000 734 +++ b/z Thu Jan 01 00:00:00 1970 +0000
733 @@ -0,0 +1,1 @@ 735 @@ -0,0 +1,1 @@
734 +z 736 +z
737
738 $ cd ..
739
740 Resolving content-divergence of a stack with same parents
741 ---------------------------------------------------------
742
743 $ hg init stacktest
744 $ cd stacktest
745 $ echo ".*\.orig" > .hgignore
746 $ hg add .hgignore
747 $ hg ci -m "added hgignore"
748 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
749
750 $ hg glog
751 @ 4:c41c793e0ef1 added d
752 | () [default] draft
753 o 3:ca1b80f7960a added c
754 | () [default] draft
755 o 2:b1661037fa25 added b
756 | () [default] draft
757 o 1:c7586e2a9264 added a
758 | () [default] draft
759 o 0:8fa14d15e168 added hgignore
760 () [default] draft
761
762 $ cd ..
763 $ hg init stack2
764 $ cd stack2
765 $ hg pull ../stacktest
766 pulling from ../stacktest
767 requesting all changes
768 adding changesets
769 adding manifests
770 adding file changes
771 added 5 changesets with 5 changes to 5 files
772 new changesets 8fa14d15e168:c41c793e0ef1
773 (run 'hg update' to get a working copy)
774 $ hg glog
775 o 4:c41c793e0ef1 added d
776 | () [default] draft
777 o 3:ca1b80f7960a added c
778 | () [default] draft
779 o 2:b1661037fa25 added b
780 | () [default] draft
781 o 1:c7586e2a9264 added a
782 | () [default] draft
783 o 0:8fa14d15e168 added hgignore
784 () [default] draft
785
786 $ hg up c7586e2a9264
787 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
788 $ echo bar > a
789 $ hg amend -m "watbar to a"
790 3 new orphan changesets
791 $ hg evolve --all
792 move:[2] added b
793 atop:[5] watbar to a
794 move:[3] added c
795 atop:[6] added b
796 move:[4] added d
797 atop:[7] added c
798 working directory is now at 513e3267034e
799 $ hg glog
800 @ 8:513e3267034e added d
801 | () [default] draft
802 o 7:accb7a2b6ae9 added c
803 | () [default] draft
804 o 6:60280764eb0e added b
805 | () [default] draft
806 o 5:2587cb3ef1fe watbar to a
807 | () [default] draft
808 o 0:8fa14d15e168 added hgignore
809 () [default] draft
810
811 $ cd ../stacktest
812 $ hg up .^^^
813 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
814 $ echo wat > a
815 $ hg amend -m "watbar to a"
816 3 new orphan changesets
817 $ hg evolve --all
818 move:[2] added b
819 atop:[5] watbar to a
820 move:[3] added c
821 atop:[6] added b
822 move:[4] added d
823 atop:[7] added c
824 working directory is now at c72d2885eb51
825 $ hg glog
826 @ 8:c72d2885eb51 added d
827 | () [default] draft
828 o 7:3ce4be6d8e5e added c
829 | () [default] draft
830 o 6:d5f148423c16 added b
831 | () [default] draft
832 o 5:8e222f257bbf watbar to a
833 | () [default] draft
834 o 0:8fa14d15e168 added hgignore
835 () [default] draft
836
837 $ hg pull ../stack2
838 pulling from ../stack2
839 searching for changes
840 adding changesets
841 adding manifests
842 adding file changes
843 added 4 changesets with 1 changes to 4 files (+1 heads)
844 4 new obsolescence markers
845 8 new content-divergent changesets
846 new changesets 2587cb3ef1fe:513e3267034e
847 (run 'hg heads' to see heads, 'hg merge' to merge)
848
849 $ hg glog
850 * 12:513e3267034e added d
851 | () [default] draft
852 * 11:accb7a2b6ae9 added c
853 | () [default] draft
854 * 10:60280764eb0e added b
855 | () [default] draft
856 * 9:2587cb3ef1fe watbar to a
857 | () [default] draft
858 | @ 8:c72d2885eb51 added d
859 | | () [default] draft
860 | * 7:3ce4be6d8e5e added c
861 | | () [default] draft
862 | * 6:d5f148423c16 added b
863 | | () [default] draft
864 | * 5:8e222f257bbf watbar to a
865 |/ () [default] draft
866 o 0:8fa14d15e168 added hgignore
867 () [default] draft
868
869 XXX: we are not resolving divergence in the correct order here
870 $ hg evolve --all --content-divergent
871 skipping c72d2885eb51: have a different parent than 513e3267034e (not handled yet)
872 | c72d2885eb51, 513e3267034e are not based on the same changeset.
873 | With the current state of its implementation,
874 | evolve does not work in that case.
875 | rebase one of them next to the other and run
876 | this command again.
877 | - either: hg rebase --dest 'p1(c72d2885eb51)' -r 513e3267034e
878 | - or: hg rebase --dest 'p1(513e3267034e)' -r c72d2885eb51
879 merge:[5] watbar to a
880 with: [9] watbar to a
881 base: [1] added a
882 updating to "local" side of the conflict: 8e222f257bbf
883 merging "other" content-divergent changeset '2587cb3ef1fe'
884 merging a
885 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
886 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
887 abort: fix conflicts and see `hg help evolve.interrupted`
888 [255]
889
890 $ echo watbar > a
891 $ hg resolve -m
892 (no more unresolved files)
893 continue: hg evolve --continue
894
895 $ hg evolve --continue
896 6 new orphan changesets
897 skipping d5f148423c16: have a different parent than 60280764eb0e (not handled yet)
898 | d5f148423c16, 60280764eb0e are not based on the same changeset.
899 | With the current state of its implementation,
900 | evolve does not work in that case.
901 | rebase one of them next to the other and run
902 | this command again.
903 | - either: hg rebase --dest 'p1(d5f148423c16)' -r 60280764eb0e
904 | - or: hg rebase --dest 'p1(60280764eb0e)' -r d5f148423c16
905 skipping 3ce4be6d8e5e: have a different parent than accb7a2b6ae9 (not handled yet)
906 | 3ce4be6d8e5e, accb7a2b6ae9 are not based on the same changeset.
907 | With the current state of its implementation,
908 | evolve does not work in that case.
909 | rebase one of them next to the other and run
910 | this command again.
911 | - either: hg rebase --dest 'p1(3ce4be6d8e5e)' -r accb7a2b6ae9
912 | - or: hg rebase --dest 'p1(accb7a2b6ae9)' -r 3ce4be6d8e5e
913 working directory is now at df46e196f3c4
914
915 $ hg glog
916 @ 13:df46e196f3c4 watbar to a
917 | () [default] draft
918 | * 12:513e3267034e added d
919 | | () [default] draft
920 | * 11:accb7a2b6ae9 added c
921 | | () [default] draft
922 | * 10:60280764eb0e added b
923 | | () [default] draft
924 | x 9:2587cb3ef1fe watbar to a
925 |/ () [default] draft
926 | * 8:c72d2885eb51 added d
927 | | () [default] draft
928 | * 7:3ce4be6d8e5e added c
929 | | () [default] draft
930 | * 6:d5f148423c16 added b
931 | | () [default] draft
932 | x 5:8e222f257bbf watbar to a
933 |/ () [default] draft
934 o 0:8fa14d15e168 added hgignore
935 () [default] draft