Show More
@@ -136,25 +136,24 b' def findcopies(repo, m1, m2, ma, limit):' | |||
|
136 | 136 | |
|
137 | 137 | def checkpair(c, f2, man): |
|
138 | 138 | ''' check if an apparent pair actually matches ''' |
|
139 | if f2 not in man: | |
|
140 | return | |
|
139 | 141 | c2 = ctx(f2, man[f2]) |
|
140 | 142 | ca = c.ancestor(c2) |
|
141 | 143 | if not ca or c == ca or c2 == ca: |
|
142 | 144 | return |
|
143 | 145 | if ca.path() == c.path() or ca.path() == c2.path(): |
|
144 | 146 | copy[c.path()] = f2 |
|
145 | copy[f2] = c.path() | |
|
146 | 147 | |
|
147 | 148 | for f in u1: |
|
148 | 149 | c = ctx(dcopies.get(f, f), m1[f]) |
|
149 | 150 | for of in findold(c, limit): |
|
150 |
|
|
|
151 | checkpair(c, of, m2) | |
|
151 | checkpair(c, of, m2) | |
|
152 | 152 | |
|
153 | 153 | for f in u2: |
|
154 | 154 | c = ctx(f, m2[f]) |
|
155 | 155 | for of in findold(c, limit): |
|
156 |
|
|
|
157 | checkpair(c, of, m1) | |
|
156 | checkpair(c, of, m1) | |
|
158 | 157 | |
|
159 | 158 | return copy |
|
160 | 159 | |
@@ -176,7 +175,6 b' def manifestmerge(repo, p1, p2, pa, over' | |||
|
176 | 175 | backwards = (pa == p2) |
|
177 | 176 | action = [] |
|
178 | 177 | copy = {} |
|
179 | copied = {} | |
|
180 | 178 | |
|
181 | 179 | def fmerge(f, f2=None, fa=None): |
|
182 | 180 | """merge executable flags""" |
@@ -192,6 +190,7 b' def manifestmerge(repo, p1, p2, pa, over' | |||
|
192 | 190 | |
|
193 | 191 | if pa and not (backwards or overwrite): |
|
194 | 192 | copy = findcopies(repo, m1, m2, ma, pa.rev()) |
|
193 | copied = dict.fromkeys(copy.values()) | |
|
195 | 194 | |
|
196 | 195 | # Compare manifests |
|
197 | 196 | for f, n in m1.iteritems(): |
@@ -216,19 +215,16 b' def manifestmerge(repo, p1, p2, pa, over' | |||
|
216 | 215 | elif m1.execf(f) != m2.execf(f): |
|
217 | 216 | if overwrite or fmerge(f) != m1.execf(f): |
|
218 | 217 | act("update permissions", "e", f, m2.execf(f)) |
|
218 | elif f in copied: | |
|
219 | continue | |
|
219 | 220 | elif f in copy: |
|
220 | 221 | f2 = copy[f] |
|
221 | copied[f2] = True | |
|
222 | if f in ma: # case 3,20 A/B/A | |
|
223 | act("remote moved to " + f2, "m", | |
|
224 | f, f2, f2, fmerge(f, f2, f), True) | |
|
225 | else: | |
|
226 | if f2 in m1: # case 2 A,B/B/B | |
|
227 | act("local copied to " + f2, "m", | |
|
228 | f, f2, f, fmerge(f, f2, f2), False) | |
|
229 | else: # case 4,21 A/B/B | |
|
230 | act("local moved to " + f2, "m", | |
|
231 | f, f2, f, fmerge(f, f2, f2), False) | |
|
222 | if f2 in m1: # case 2 A,B/B/B | |
|
223 | act("local copied to " + f2, "m", | |
|
224 | f, f2, f, fmerge(f, f2, f2), False) | |
|
225 | else: # case 4,21 A/B/B | |
|
226 | act("local moved to " + f2, "m", | |
|
227 | f, f2, f, fmerge(f, f2, f2), False) | |
|
232 | 228 | elif f in ma: |
|
233 | 229 | if n != ma[f] and not overwrite: |
|
234 | 230 | if repo.ui.prompt( |
@@ -251,9 +247,12 b' def manifestmerge(repo, p1, p2, pa, over' | |||
|
251 | 247 | continue |
|
252 | 248 | if f in copy: |
|
253 | 249 | f2 = copy[f] |
|
254 | # rename case 1, A/A,B/A | |
|
255 | act("remote copied to " + f, "m", | |
|
256 | f2, f, f, fmerge(f2, f, f2), False) | |
|
250 | if f2 in m2: # rename case 1, A/A,B/A | |
|
251 | act("remote copied to " + f, "m", | |
|
252 | f2, f, f, fmerge(f2, f, f2), False) | |
|
253 | else: # case 3,20 A/B/A | |
|
254 | act("remote moved to " + f, "m", | |
|
255 | f2, f, f, fmerge(f2, f, f2), True) | |
|
257 | 256 | elif f in ma: |
|
258 | 257 | if overwrite or backwards: |
|
259 | 258 | act("recreating", "g", f, m2.execf(f)) |
@@ -47,8 +47,8 b' test L:up a R:nm a b W: - 3 get' | |||
|
47 | 47 | resolving manifests |
|
48 | 48 | overwrite None partial False |
|
49 | 49 | ancestor 924404dff337 local e300d1c794ec+ remote e03727d2d66b |
|
50 | rev: versions differ -> m | |
|
50 | 51 | a: remote moved to b -> m |
|
51 | rev: versions differ -> m | |
|
52 | 52 | merging a and b |
|
53 | 53 | my a@e300d1c794ec+ other b@e03727d2d66b ancestor a@924404dff337 |
|
54 | 54 | copying a to b |
@@ -351,8 +351,8 b' test L:up a R:um a b W: - 20 mer' | |||
|
351 | 351 | resolving manifests |
|
352 | 352 | overwrite None partial False |
|
353 | 353 | ancestor 924404dff337 local e300d1c794ec+ remote 79cc6877a3b7 |
|
354 | rev: versions differ -> m | |
|
354 | 355 | a: remote moved to b -> m |
|
355 | rev: versions differ -> m | |
|
356 | 356 | merging a and b |
|
357 | 357 | my a@e300d1c794ec+ other b@79cc6877a3b7 ancestor a@924404dff337 |
|
358 | 358 | copying a to b |
General Comments 0
You need to be logged in to leave comments.
Login now