##// END OF EJS Templates
tests: demonstrate broken rebase of merge with p1's successor in dest...
Martin von Zweigbergk -
r33640:644dddcc default
parent child Browse files
Show More
@@ -13,6 +13,7 b' Enable obsolete'
13 > publish=False
13 > publish=False
14 > [extensions]
14 > [extensions]
15 > rebase=
15 > rebase=
16 > drawdag=$TESTDIR/drawdag.py
16 > EOF
17 > EOF
17
18
18 Setup rebase canonical repo
19 Setup rebase canonical repo
@@ -896,55 +897,202 b' Create the changes that we will rebase'
896 rebasing 22:7bdc8a87673d "dummy change" (tip)
897 rebasing 22:7bdc8a87673d "dummy change" (tip)
897 $ cd ..
898 $ cd ..
898
899
899 rebase source is obsoleted (issue5198)
900 Rebase merge where successor of one parent is equal to destination (issue5198)
900 ---------------------------------
901
902 $ hg init p1-succ-is-dest
903 $ cd p1-succ-is-dest
901
904
902 $ hg clone base amended
905 $ hg debugdrawdag <<EOF
903 updating to branch default
906 > F
904 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
907 > /|
905 $ cd amended
908 > E D B # replace: D -> B
906 $ hg up 9520eea781bc
909 > \|/
907 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
910 > A
908 $ echo 1 >> E
911 > EOF
909 $ hg commit --amend -m "E'" -d "0 0"
912
913 $ hg rebase -d B -s D
914 note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B"
915 rebasing 4:66f1a38021c9 "F" (F tip)
910 $ hg log -G
916 $ hg log -G
911 @ 9:69abe8906104 E'
917 o 5:50e9d60b99c6 F
912 |
918 |\
913 | o 7:02de42196ebe H
919 | | x 4:66f1a38021c9 F
914 | |
915 | | o 6:eea13746799a G
916 | |/|
920 | |/|
917 | o | 5:24b6387c8c8c F
921 | o | 3:7fb047a69f22 E
918 |/ /
922 | | |
919 | x 4:9520eea781bc E
923 | | x 2:b18e25de2cf5 D
924 | |/
925 o | 1:112478962961 B
920 |/
926 |/
921 | o 3:32af7686d403 D
927 o 0:426bada5c675 A
928
929 $ cd ..
930
931 Rebase merge where successor of other parent is equal to destination
932
933 $ hg init p2-succ-is-dest
934 $ cd p2-succ-is-dest
935
936 $ hg debugdrawdag <<EOF
937 > F
938 > /|
939 > E D B # replace: E -> B
940 > \|/
941 > A
942 > EOF
943
944 BROKEN: Raises an exception
945 $ hg rebase -d B -s E 2>&1 | grep AssertionError:
946 AssertionError: no base found to rebase on (defineparents called wrong)
947 $ hg log -G
948 o 4:66f1a38021c9 F
949 |\
950 | x 3:7fb047a69f22 E
922 | |
951 | |
923 | o 2:5fddd98957c8 C
952 o | 2:b18e25de2cf5 D
924 | |
925 | o 1:42ccdea3bb16 B
926 |/
953 |/
927 o 0:cd010b8cd998 A
954 | o 1:112478962961 B
955 |/
956 o 0:426bada5c675 A
928
957
929 $ hg rebase -d . -s 9520eea781bc
958 $ cd ..
930 note: not rebasing 4:9520eea781bc "E", already in destination as 9:69abe8906104 "E'"
959
931 rebasing 6:eea13746799a "G"
960 Rebase merge where successor of one parent is ancestor of destination
961
962 $ hg init p1-succ-in-dest
963 $ cd p1-succ-in-dest
964
965 $ hg debugdrawdag <<EOF
966 > F C
967 > /| |
968 > E D B # replace: D -> B
969 > \|/
970 > A
971 > EOF
972
973 $ hg rebase -d C -s D
974 note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B"
975 rebasing 5:66f1a38021c9 "F" (F tip)
976 BROKEN: not rebased on top of requested destination (C)
932 $ hg log -G
977 $ hg log -G
933 o 10:17be06e82e95 G
978 o 6:50e9d60b99c6 F
979 |\
980 | | x 5:66f1a38021c9 F
981 | |/|
982 +-----o 4:26805aba1e60 C
983 | | |
984 | o | 3:7fb047a69f22 E
985 | | |
986 | | x 2:b18e25de2cf5 D
987 | |/
988 o | 1:112478962961 B
989 |/
990 o 0:426bada5c675 A
991
992 $ cd ..
993
994 Rebase merge where successor of other parent is ancestor of destination
995
996 $ hg init p2-succ-in-dest
997 $ cd p2-succ-in-dest
998
999 $ hg debugdrawdag <<EOF
1000 > F C
1001 > /| |
1002 > E D B # replace: E -> B
1003 > \|/
1004 > A
1005 > EOF
1006
1007 BROKEN: Raises an exception
1008 $ hg rebase -d C -s E 2>&1 | grep AssertionError:
1009 AssertionError: no base found to rebase on (defineparents called wrong)
1010 $ hg log -G
1011 o 5:66f1a38021c9 F
934 |\
1012 |\
935 | @ 9:69abe8906104 E'
1013 | | o 4:26805aba1e60 C
936 | |
1014 | | |
937 +---o 7:02de42196ebe H
1015 | x | 3:7fb047a69f22 E
938 | |
1016 | | |
939 o | 5:24b6387c8c8c F
1017 o | | 2:b18e25de2cf5 D
1018 |/ /
1019 | o 1:112478962961 B
940 |/
1020 |/
941 | o 3:32af7686d403 D
1021 o 0:426bada5c675 A
942 | |
1022
943 | o 2:5fddd98957c8 C
1023 $ cd ..
944 | |
1024
945 | o 1:42ccdea3bb16 B
1025 Rebase merge where successor of one parent is ancestor of destination
1026
1027 $ hg init p1-succ-in-dest-b
1028 $ cd p1-succ-in-dest-b
1029
1030 $ hg debugdrawdag <<EOF
1031 > F C
1032 > /| |
1033 > E D B # replace: E -> B
1034 > \|/
1035 > A
1036 > EOF
1037
1038 $ hg rebase -d C -b F
1039 rebasing 2:b18e25de2cf5 "D" (D)
1040 note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B"
1041 rebasing 5:66f1a38021c9 "F" (F tip)
1042 $ hg log -G
1043 o 7:9ed45af61fa0 F
1044 |
1045 o 6:8f47515dda15 D
1046 |
1047 | x 5:66f1a38021c9 F
1048 | |\
1049 o | | 4:26805aba1e60 C
1050 | | |
1051 | | x 3:7fb047a69f22 E
1052 | | |
1053 | x | 2:b18e25de2cf5 D
1054 | |/
1055 o / 1:112478962961 B
946 |/
1056 |/
947 o 0:cd010b8cd998 A
1057 o 0:426bada5c675 A
1058
1059 $ cd ..
1060
1061 Rebase merge where successor of other parent is ancestor of destination
1062
1063 $ hg init p2-succ-in-dest-b
1064 $ cd p2-succ-in-dest-b
1065
1066 $ hg debugdrawdag <<EOF
1067 > F C
1068 > /| |
1069 > E D B # replace: D -> B
1070 > \|/
1071 > A
1072 > EOF
1073
1074 $ hg rebase -d C -b F
1075 note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B"
1076 rebasing 3:7fb047a69f22 "E" (E)
1077 rebasing 5:66f1a38021c9 "F" (F tip)
1078 BROKEN: This should have resulted in a rebased F with one parent, just like in
1079 the test case above
1080 $ hg log -G
1081 o 7:c1e6f26e339d F
1082 |\
1083 | o 6:533690786a86 E
1084 |/
1085 | x 5:66f1a38021c9 F
1086 | |\
1087 o | | 4:26805aba1e60 C
1088 | | |
1089 | | x 3:7fb047a69f22 E
1090 | | |
1091 | x | 2:b18e25de2cf5 D
1092 | |/
1093 o / 1:112478962961 B
1094 |/
1095 o 0:426bada5c675 A
948
1096
949 $ cd ..
1097 $ cd ..
950
1098
General Comments 0
You need to be logged in to leave comments. Login now