Mercurial > evolve
comparison tests/test-split.t @ 4345:f45b4c31d81f
evolve: add test which shows fixed behaviour of `hg evolve` (issue5686)
author | Sushil khanchi <sushilkhanchi97@gmail.com> |
---|---|
date | Fri, 18 Jan 2019 13:54:30 +0530 |
parents | 702f7e1d0b01 |
children | a71f2271ed76 c09889f81947 2a593d8f07e7 |
comparison
equal
deleted
inserted
replaced
4344:e5282131a78d | 4345:f45b4c31d81f |
---|---|
2 ----------------------- | 2 ----------------------- |
3 | 3 |
4 $ . $TESTDIR/testlib/common.sh | 4 $ . $TESTDIR/testlib/common.sh |
5 | 5 |
6 $ cat >> $HGRCPATH <<EOF | 6 $ cat >> $HGRCPATH <<EOF |
7 > [alias] | |
8 > glog = log -G -T "{rev}:{node|short} {desc|firstline} ({phase})\n" | |
7 > [defaults] | 9 > [defaults] |
8 > amend=-d "0 0" | 10 > amend=-d "0 0" |
9 > fold=-d "0 0" | 11 > fold=-d "0 0" |
10 > split=-d "0 0" | 12 > split=-d "0 0" |
11 > amend=-d "0 0" | 13 > amend=-d "0 0" |
971 no more change to split | 973 no more change to split |
972 $ hg status --change '.' | 974 $ hg status --change '.' |
973 A SPLIT2 | 975 A SPLIT2 |
974 A SPLIT3 | 976 A SPLIT3 |
975 A SPLIT4 | 977 A SPLIT4 |
978 | |
979 $ cd .. | |
980 | |
981 Testing that `hg evolve` choose right destination after split && prune (issue5686) | |
982 -------------------------------------------------------------------------------- | |
983 | |
984 Prepare the repository: | |
985 $ hg init issue5686 | |
986 $ cd issue5686 | |
987 $ echo p > p | |
988 $ hg ci -Amp | |
989 adding p | |
990 | |
991 $ for ch in a b; do echo $ch > $ch; done; | |
992 $ hg ci -Am "added a and b" | |
993 adding a | |
994 adding b | |
995 $ echo c > c | |
996 $ hg ci -Amc | |
997 adding c | |
998 $ hg glog | |
999 @ 2:ab6ca3ebca74 c (draft) | |
1000 | | |
1001 o 1:79f47e067e66 added a and b (draft) | |
1002 | | |
1003 o 0:a5a1faba8d26 p (draft) | |
1004 | |
1005 | |
1006 To create commits with the number of split | |
1007 $ echo 0 > num | |
1008 $ cat > editor.sh << '__EOF__' | |
1009 > NUM=$(cat num) | |
1010 > NUM=`expr "$NUM" + 1` | |
1011 > echo "$NUM" > num | |
1012 > echo "split$NUM" > "$1" | |
1013 > __EOF__ | |
1014 $ export HGEDITOR="\"sh\" \"editor.sh\"" | |
1015 | |
1016 Splitting the revision 1 to SPLIT1 and SPLIT2 which contains file a and b resp: | |
1017 $ hg split -r 1 <<EOF | |
1018 > y | |
1019 > y | |
1020 > n | |
1021 > y | |
1022 > y | |
1023 > y | |
1024 > EOF | |
1025 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
1026 adding a | |
1027 adding b | |
1028 diff --git a/a b/a | |
1029 new file mode 100644 | |
1030 examine changes to 'a'? [Ynesfdaq?] y | |
1031 | |
1032 @@ -0,0 +1,1 @@ | |
1033 +a | |
1034 record change 1/2 to 'a'? [Ynesfdaq?] y | |
1035 | |
1036 diff --git a/b b/b | |
1037 new file mode 100644 | |
1038 examine changes to 'b'? [Ynesfdaq?] n | |
1039 | |
1040 created new head | |
1041 (consider using topic for lightweight branches. See 'hg help topic') | |
1042 continue splitting? [Ycdq?] y | |
1043 diff --git a/b b/b | |
1044 new file mode 100644 | |
1045 examine changes to 'b'? [Ynesfdaq?] y | |
1046 | |
1047 @@ -0,0 +1,1 @@ | |
1048 +b | |
1049 record this change to 'b'? [Ynesfdaq?] y | |
1050 | |
1051 no more change to split | |
1052 1 new orphan changesets | |
1053 | |
1054 $ hg glog -p | |
1055 @ 4:5cf253fa63fa split2 (draft) | |
1056 | diff --git a/b b/b | |
1057 | new file mode 100644 | |
1058 | --- /dev/null | |
1059 | +++ b/b | |
1060 | @@ -0,0 +1,1 @@ | |
1061 | +b | |
1062 | | |
1063 o 3:88437e073cd4 split1 (draft) | |
1064 | diff --git a/a b/a | |
1065 | new file mode 100644 | |
1066 | --- /dev/null | |
1067 | +++ b/a | |
1068 | @@ -0,0 +1,1 @@ | |
1069 | +a | |
1070 | | |
1071 | * 2:ab6ca3ebca74 c (draft) | |
1072 | | diff --git a/c b/c | |
1073 | | new file mode 100644 | |
1074 | | --- /dev/null | |
1075 | | +++ b/c | |
1076 | | @@ -0,0 +1,1 @@ | |
1077 | | +c | |
1078 | | | |
1079 | x 1:79f47e067e66 added a and b (draft) | |
1080 |/ diff --git a/a b/a | |
1081 | new file mode 100644 | |
1082 | --- /dev/null | |
1083 | +++ b/a | |
1084 | @@ -0,0 +1,1 @@ | |
1085 | +a | |
1086 | diff --git a/b b/b | |
1087 | new file mode 100644 | |
1088 | --- /dev/null | |
1089 | +++ b/b | |
1090 | @@ -0,0 +1,1 @@ | |
1091 | +b | |
1092 | | |
1093 o 0:a5a1faba8d26 p (draft) | |
1094 diff --git a/p b/p | |
1095 new file mode 100644 | |
1096 --- /dev/null | |
1097 +++ b/p | |
1098 @@ -0,0 +1,1 @@ | |
1099 +p | |
1100 | |
1101 Now if we prune revision 4 the expected destination of orphan cset 2 is 3. Lets | |
1102 check evolve does as expected: | |
1103 Pruning revision 4 (current one): | |
1104 $ hg prune . | |
1105 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1106 working directory now at 88437e073cd4 | |
1107 1 changesets pruned | |
1108 $ hg evolve -r 2 | |
1109 move:[2] c | |
1110 atop:[3] split1 | |
1111 working directory is now at 21a63bd6ee88 | |
1112 $ hg glog | |
1113 @ 5:21a63bd6ee88 c (draft) | |
1114 | | |
1115 o 3:88437e073cd4 split1 (draft) | |
1116 | | |
1117 o 0:a5a1faba8d26 p (draft) | |
1118 |