##// END OF EJS Templates
mergecopies: invoke _computenonoverlap for both base and tca during merges...
Gábor Stefanik -
r30197:0accd5a5 default
parent child Browse files
Show More
@@ -373,9 +373,21 def mergecopies(repo, c1, c2, base):
373 # find interesting file sets from manifests
373 # find interesting file sets from manifests
374 addedinm1 = m1.filesnotin(mb)
374 addedinm1 = m1.filesnotin(mb)
375 addedinm2 = m2.filesnotin(mb)
375 addedinm2 = m2.filesnotin(mb)
376 bothnew = sorted(addedinm1 & addedinm2)
377 if tca == base:
378 # unmatched file from base
376 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
379 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
377 u1u, u2u = u1r, u2r
380 u1u, u2u = u1r, u2r
378 bothnew = sorted(addedinm1 & addedinm2)
381 else:
382 # unmatched file from base (DAG rotation in the graft case)
383 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2,
384 baselabel='base')
385 # unmatched file from topological common ancestors (no DAG rotation)
386 # need to recompute this for directory move handling when grafting
387 mta = tca.manifest()
388 u1u, u2u = _computenonoverlap(repo, c1, c2, m1.filesnotin(mta),
389 m2.filesnotin(mta),
390 baselabel='topological common ancestor')
379
391
380 for f in u1u:
392 for f in u1u:
381 _checkcopies(c1, f, m1, m2, base, tca, limit, data1)
393 _checkcopies(c1, f, m1, m2, base, tca, limit, data1)
@@ -179,6 +179,11 Graft out of order, skipping a merge and
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
@@ -193,6 +198,11 Graft out of order, skipping a merge and
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
@@ -945,6 +955,7 two renames actually converge to the sam
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
@@ -957,14 +968,15 two renames actually converge to the sam
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
@@ -989,12 +1001,12 Set up the repository for some further t
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
@@ -1029,6 +1041,7 and A.3 with a local content change to b
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]
@@ -1037,7 +1050,8 and A.3 with a local content change to b
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
@@ -1051,7 +1065,7 Test the cases A.1 (f4x) and A.7 (f3x).
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
@@ -1073,13 +1087,30 Check the results of the grafts tested
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
@@ -1147,7 +1178,7 Check the results of the grafts tested
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
@@ -1168,21 +1199,21 Check the results of the grafts tested
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
@@ -238,6 +238,8 Check that the right ancestors is used w
238 merge against 9:e31216eec445
238 merge against 9:e31216eec445
239 detach base 8:8e4e2c1a07ae
239 detach base 8:8e4e2c1a07ae
240 searching for copies back to rev 3
240 searching for copies back to rev 3
241 unmatched files in other (from topological common ancestor):
242 f2.txt
241 resolving manifests
243 resolving manifests
242 branchmerge: True, force: True, partial: False
244 branchmerge: True, force: True, partial: False
243 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
245 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
@@ -255,6 +257,8 Check that the right ancestors is used w
255 merge against 10:2f2496ddf49d
257 merge against 10:2f2496ddf49d
256 detach base 9:e31216eec445
258 detach base 9:e31216eec445
257 searching for copies back to rev 3
259 searching for copies back to rev 3
260 unmatched files in other (from topological common ancestor):
261 f2.txt
258 resolving manifests
262 resolving manifests
259 branchmerge: True, force: True, partial: False
263 branchmerge: True, force: True, partial: False
260 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
264 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
General Comments 0
You need to be logged in to leave comments. Login now