Mercurial > hg
comparison tests/test-graft.t @ 30197:0accd5a5ad04
mergecopies: invoke _computenonoverlap for both base and tca during merges
The algorithm of _checkcopies can only walk backwards in the DAG, never
forward. Because of this, the two _checkcopies patches need to run from
their respective endpoints to the TCA to cover the entire subgraph where
the merge is being performed. However, detection of files new in both
endpoints, as well as directory rename detection, need to run with respect
to the merge base, so we need lists of new files both from the TCA's and
the merge base's viewpoint to correctly detect renames in a graft-like
merge scenario.
(Series reworked by Pierre-Yves David)
author | Gábor Stefanik <gabor.stefanik@nng.com> |
---|---|
date | Thu, 13 Oct 2016 02:19:43 +0200 |
parents | 509d29255c04 |
children | 856ead835f56 |
comparison
equal
deleted
inserted
replaced
30196:d738cda70894 | 30197:0accd5a5ad04 |
---|---|
177 b | 177 b |
178 committing manifest | 178 committing manifest |
179 committing changelog | 179 committing changelog |
180 grafting 5:97f8bfe72746 "5" | 180 grafting 5:97f8bfe72746 "5" |
181 searching for copies back to rev 1 | 181 searching for copies back to rev 1 |
182 unmatched files in other (from topological common ancestor): | |
183 c | |
184 all copies found (* = to merge, ! = divergent, % = renamed and deleted): | |
185 src: 'c' -> dst: 'b' * | |
186 checking for directory renames | |
182 resolving manifests | 187 resolving manifests |
183 branchmerge: True, force: True, partial: False | 188 branchmerge: True, force: True, partial: False |
184 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746 | 189 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746 |
185 e: remote is newer -> g | 190 e: remote is newer -> g |
186 getting e | 191 getting e |
191 committing changelog | 196 committing changelog |
192 $ HGEDITOR=cat hg graft 4 3 --log --debug | 197 $ HGEDITOR=cat hg graft 4 3 --log --debug |
193 scanning for duplicate grafts | 198 scanning for duplicate grafts |
194 grafting 4:9c233e8e184d "4" | 199 grafting 4:9c233e8e184d "4" |
195 searching for copies back to rev 1 | 200 searching for copies back to rev 1 |
201 unmatched files in other (from topological common ancestor): | |
202 c | |
203 all copies found (* = to merge, ! = divergent, % = renamed and deleted): | |
204 src: 'c' -> dst: 'b' * | |
205 checking for directory renames | |
196 resolving manifests | 206 resolving manifests |
197 branchmerge: True, force: True, partial: False | 207 branchmerge: True, force: True, partial: False |
198 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d | 208 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d |
199 preserving e for resolve of e | 209 preserving e for resolve of e |
200 d: remote is newer -> g | 210 d: remote is newer -> g |
943 two renames actually converge to the same name (thus no actual divergence). | 953 two renames actually converge to the same name (thus no actual divergence). |
944 | 954 |
945 $ hg up -q 'desc("A0")' | 955 $ hg up -q 'desc("A0")' |
946 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit | 956 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit |
947 grafting 2:f58c7e2b28fa "C0" | 957 grafting 2:f58c7e2b28fa "C0" |
958 merging f1a and f1b to f1a | |
948 merging f5a | 959 merging f5a |
949 warning: conflicts while merging f5a! (edit, then use 'hg resolve --mark') | 960 warning: conflicts while merging f5a! (edit, then use 'hg resolve --mark') |
950 abort: unresolved conflicts, can't continue | 961 abort: unresolved conflicts, can't continue |
951 (use 'hg resolve' and 'hg graft --continue') | 962 (use 'hg resolve' and 'hg graft --continue') |
952 [255] | 963 [255] |
955 continue: hg graft --continue | 966 continue: hg graft --continue |
956 $ hg graft --continue # XXX work around failure | 967 $ hg graft --continue # XXX work around failure |
957 grafting 2:f58c7e2b28fa "C0" | 968 grafting 2:f58c7e2b28fa "C0" |
958 warning: can't find ancestor for 'f5a' copied from 'f5b'! | 969 warning: can't find ancestor for 'f5a' copied from 'f5b'! |
959 $ hg status --change . | 970 $ hg status --change . |
971 M f1a | |
960 M f5a | 972 M f5a |
961 A f1b | |
962 A f2c | 973 A f2c |
963 R f2a | 974 R f2a |
964 $ hg cat f1a | 975 $ hg cat f1a |
965 c1a | 976 c1c |
966 $ hg cat f1b | 977 $ hg cat f1b |
967 c1c | 978 f1b: no such file in rev 43e4b415492d |
979 [1] | |
968 | 980 |
969 Test the cases A.0 (f4x) and A.6 (f3x) | 981 Test the cases A.0 (f4x) and A.6 (f3x) |
970 | 982 |
971 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit | 983 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit |
972 grafting 3:b69f5839d2d9 "D0" | 984 grafting 3:b69f5839d2d9 "D0" |
987 | parent: 0:11f7a1b56675 | 999 | parent: 0:11f7a1b56675 |
988 | user: test | 1000 | user: test |
989 | date: Thu Jan 01 00:00:00 1970 +0000 | 1001 | date: Thu Jan 01 00:00:00 1970 +0000 |
990 | summary: E0 | 1002 | summary: E0 |
991 | | 1003 | |
992 | o changeset: 5:573bb6b4b56d | 1004 | o changeset: 5:4f4ba7a6e606 |
993 | | user: test | 1005 | | user: test |
994 | | date: Thu Jan 01 00:00:00 1970 +0000 | 1006 | | date: Thu Jan 01 00:00:00 1970 +0000 |
995 | | summary: D1 | 1007 | | summary: D1 |
996 | | | 1008 | | |
997 | o changeset: 4:af23416e619b | 1009 | o changeset: 4:43e4b415492d |
998 |/ parent: 0:11f7a1b56675 | 1010 |/ parent: 0:11f7a1b56675 |
999 | user: test | 1011 | user: test |
1000 | date: Thu Jan 01 00:00:00 1970 +0000 | 1012 | date: Thu Jan 01 00:00:00 1970 +0000 |
1001 | summary: C0 | 1013 | summary: C0 |
1002 | | 1014 | |
1027 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit | 1039 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit |
1028 grafting 2:f58c7e2b28fa "C0" | 1040 grafting 2:f58c7e2b28fa "C0" |
1029 other [graft] changed f1b which local [local] deleted | 1041 other [graft] changed f1b which local [local] deleted |
1030 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u | 1042 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u |
1031 merging f2a and f2c to f2c | 1043 merging f2a and f2c to f2c |
1044 merging f5b and f5a to f5a | |
1032 abort: unresolved conflicts, can't continue | 1045 abort: unresolved conflicts, can't continue |
1033 (use 'hg resolve' and 'hg graft --continue') | 1046 (use 'hg resolve' and 'hg graft --continue') |
1034 [255] | 1047 [255] |
1035 $ hg resolve f1b -t ':other' # XXX work around failure | 1048 $ hg resolve f1b -t ':other' # XXX work around failure |
1036 (no more unresolved files) | 1049 (no more unresolved files) |
1037 continue: hg graft --continue | 1050 continue: hg graft --continue |
1038 $ hg graft --continue # XXX work around failure | 1051 $ hg graft --continue # XXX work around failure |
1039 grafting 2:f58c7e2b28fa "C0" | 1052 grafting 2:f58c7e2b28fa "C0" |
1040 grafting 4:af23416e619b "C0" | 1053 grafting 4:43e4b415492d "C0" |
1054 merging f1e and f1a to f1e | |
1041 merging f2c | 1055 merging f2c |
1042 warning: can't find ancestor for 'f2c' copied from 'f2a'! | 1056 warning: can't find ancestor for 'f2c' copied from 'f2a'! |
1043 | 1057 |
1044 Test the cases A.1 (f4x) and A.7 (f3x). | 1058 Test the cases A.1 (f4x) and A.7 (f3x). |
1045 | 1059 |
1049 warning: can't find ancestor for 'f3d' copied from 'f3b'! | 1063 warning: can't find ancestor for 'f3d' copied from 'f3b'! |
1050 | 1064 |
1051 Check the results of the grafts tested | 1065 Check the results of the grafts tested |
1052 | 1066 |
1053 $ hg log -CGv --patch --git | 1067 $ hg log -CGv --patch --git |
1054 @ changeset: 9:6d76b84e6e84 | 1068 @ changeset: 9:100f4d78e056 |
1055 | tag: tip | 1069 | tag: tip |
1056 | user: test | 1070 | user: test |
1057 | date: Thu Jan 01 00:00:00 1970 +0000 | 1071 | date: Thu Jan 01 00:00:00 1970 +0000 |
1058 | files: f3d f4e | 1072 | files: f3d f4e |
1059 | description: | 1073 | description: |
1071 | +++ b/f4e | 1085 | +++ b/f4e |
1072 | @@ -1,1 +1,1 @@ | 1086 | @@ -1,1 +1,1 @@ |
1073 | -c4a | 1087 | -c4a |
1074 | +c4d | 1088 | +c4d |
1075 | | 1089 | |
1076 o changeset: 8:3079ba7d03f0 | 1090 o changeset: 8:84915a7da133 |
1077 | user: test | 1091 | user: test |
1078 | date: Thu Jan 01 00:00:00 1970 +0000 | 1092 | date: Thu Jan 01 00:00:00 1970 +0000 |
1093 | files: f1e f5a.orig | |
1079 | description: | 1094 | description: |
1080 | C0 | 1095 | C0 |
1081 | | 1096 | |
1082 | | 1097 | |
1098 | diff --git a/f1e b/f1e | |
1099 | --- a/f1e | |
1100 | +++ b/f1e | |
1101 | @@ -1,1 +1,1 @@ | |
1102 | -c1a | |
1103 | +c1c | |
1104 | diff --git a/f5a.orig b/f5a.orig | |
1105 | deleted file mode 100644 | |
1106 | --- a/f5a.orig | |
1107 | +++ /dev/null | |
1108 | @@ -1,5 +0,0 @@ | |
1109 | -<<<<<<< local: 11f7a1b56675 - test: A0 | |
1110 | -c5a | |
1111 | -======= | |
1112 | -c5c | |
1113 | ->>>>>>> graft: f58c7e2b28fa - test: C0 | |
1083 | | 1114 | |
1084 o changeset: 7:dc778749ee9a | 1115 o changeset: 7:dc778749ee9a |
1085 | user: test | 1116 | user: test |
1086 | date: Thu Jan 01 00:00:00 1970 +0000 | 1117 | date: Thu Jan 01 00:00:00 1970 +0000 |
1087 | files: f1b f2a f2c f5a f5b | 1118 | files: f1b f2a f2c f5a f5b |
1145 | +>>>>>>> graft: f58c7e2b28fa - test: C0 | 1176 | +>>>>>>> graft: f58c7e2b28fa - test: C0 |
1146 | diff --git a/f5a b/f5b | 1177 | diff --git a/f5a b/f5b |
1147 | rename from f5a | 1178 | rename from f5a |
1148 | rename to f5b | 1179 | rename to f5b |
1149 | | 1180 | |
1150 | o changeset: 5:573bb6b4b56d | 1181 | o changeset: 5:4f4ba7a6e606 |
1151 | | user: test | 1182 | | user: test |
1152 | | date: Thu Jan 01 00:00:00 1970 +0000 | 1183 | | date: Thu Jan 01 00:00:00 1970 +0000 |
1153 | | files: f3d f4a | 1184 | | files: f3d f4a |
1154 | | description: | 1185 | | description: |
1155 | | D1 | 1186 | | D1 |
1166 | | +++ b/f4a | 1197 | | +++ b/f4a |
1167 | | @@ -1,1 +1,1 @@ | 1198 | | @@ -1,1 +1,1 @@ |
1168 | | -c4a | 1199 | | -c4a |
1169 | | +c4d | 1200 | | +c4d |
1170 | | | 1201 | | |
1171 | o changeset: 4:af23416e619b | 1202 | o changeset: 4:43e4b415492d |
1172 |/ parent: 0:11f7a1b56675 | 1203 |/ parent: 0:11f7a1b56675 |
1173 | user: test | 1204 | user: test |
1174 | date: Thu Jan 01 00:00:00 1970 +0000 | 1205 | date: Thu Jan 01 00:00:00 1970 +0000 |
1175 | files: f1b f2a f2c f5a | 1206 | files: f1a f2a f2c f5a |
1176 | copies: f2c (f2a) | 1207 | copies: f2c (f2a) |
1177 | description: | 1208 | description: |
1178 | C0 | 1209 | C0 |
1179 | | 1210 | |
1180 | | 1211 | |
1181 | diff --git a/f1b b/f1b | 1212 | diff --git a/f1a b/f1a |
1182 | new file mode 100644 | 1213 | --- a/f1a |
1183 | --- /dev/null | 1214 | +++ b/f1a |
1184 | +++ b/f1b | 1215 | @@ -1,1 +1,1 @@ |
1185 | @@ -0,0 +1,1 @@ | 1216 | -c1a |
1186 | +c1c | 1217 | +c1c |
1187 | diff --git a/f2a b/f2c | 1218 | diff --git a/f2a b/f2c |
1188 | rename from f2a | 1219 | rename from f2a |
1189 | rename to f2c | 1220 | rename to f2c |
1190 | diff --git a/f5a b/f5a | 1221 | diff --git a/f5a b/f5a |