Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/merge.py @ 3729:581d20773326
merge: add copied hash to simplify copy logic
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 30 Nov 2006 17:36:33 -0600 |
parents | a32b4b930079 |
children | d377f8d25662 |
comparison
equal
deleted
inserted
replaced
3728:a32b4b930079 | 3729:581d20773326 |
---|---|
174 m2 = p2.manifest() | 174 m2 = p2.manifest() |
175 ma = pa.manifest() | 175 ma = pa.manifest() |
176 backwards = (pa == p2) | 176 backwards = (pa == p2) |
177 action = [] | 177 action = [] |
178 copy = {} | 178 copy = {} |
179 copied = {} | |
179 | 180 |
180 def fmerge(f, f2=None, fa=None): | 181 def fmerge(f, f2=None, fa=None): |
181 """merge executable flags""" | 182 """merge executable flags""" |
182 if not f2: | 183 if not f2: |
183 f2 = f | 184 f2 = f |
215 elif m1.execf(f) != m2.execf(f): | 216 elif m1.execf(f) != m2.execf(f): |
216 if overwrite or fmerge(f) != m1.execf(f): | 217 if overwrite or fmerge(f) != m1.execf(f): |
217 act("update permissions", "e", f, m2.execf(f)) | 218 act("update permissions", "e", f, m2.execf(f)) |
218 elif f in copy: | 219 elif f in copy: |
219 f2 = copy[f] | 220 f2 = copy[f] |
221 copied[f2] = True | |
220 if f in ma: # case 3,20 A/B/A | 222 if f in ma: # case 3,20 A/B/A |
221 act("remote moved to " + f2, "m", | 223 act("remote moved to " + f2, "m", |
222 f, f2, f2, fmerge(f, f2, f), True) | 224 f, f2, f2, fmerge(f, f2, f), True) |
223 else: | 225 else: |
224 if f2 in m1: # case 2 A,B/B/B | 226 if f2 in m1: # case 2 A,B/B/B |
243 for f, n in m2.iteritems(): | 245 for f, n in m2.iteritems(): |
244 if partial and not partial(f): | 246 if partial and not partial(f): |
245 continue | 247 continue |
246 if f in m1: | 248 if f in m1: |
247 continue | 249 continue |
250 if f in copied: | |
251 continue | |
248 if f in copy: | 252 if f in copy: |
249 f2 = copy[f] | 253 f2 = copy[f] |
250 if f2 not in m2: # already seen | |
251 continue | |
252 # rename case 1, A/A,B/A | 254 # rename case 1, A/A,B/A |
253 act("remote copied to " + f, "m", | 255 act("remote copied to " + f, "m", |
254 f2, f, f, fmerge(f2, f, f2), False) | 256 f2, f, f, fmerge(f2, f, f2), False) |
255 elif f in ma: | 257 elif f in ma: |
256 if overwrite or backwards: | 258 if overwrite or backwards: |