comparison mercurial/merge.py @ 20642:0dc7a50345c2

merge: use the right ancestor when both sides copied the same file The tests shows no real changes because of this ... but there must be some weird corner cases where using the right ancestor for the merge planning is better than using the wrong one.
author Mads Kiilerich <madski@unity3d.com>
date Tue, 25 Feb 2014 20:29:46 +0100
parents 52929dcdd512
children c1a52dd56eb4
comparison
equal deleted inserted replaced
20641:3db9e798e004 20642:0dc7a50345c2
386 fl1 = fl2 = m1.flags(f) 386 fl1 = fl2 = m1.flags(f)
387 387
388 if partial and not partial(f): 388 if partial and not partial(f):
389 continue 389 continue
390 if n1 and n2: 390 if n1 and n2:
391 fla = ma.flags(f) 391 fa = f
392 a = ma.get(f, nullid)
393 if a == nullid:
394 fa = copy.get(f, f)
395 # Note: f as default is wrong - we can't really make a 3-way
396 # merge without an ancestor file.
397 fla = ma.flags(fa)
392 nol = 'l' not in fl1 + fl2 + fla 398 nol = 'l' not in fl1 + fl2 + fla
393 a = ma.get(f, nullid)
394 if n2 == a and fl2 == fla: 399 if n2 == a and fl2 == fla:
395 pass # remote unchanged - keep local 400 pass # remote unchanged - keep local
396 elif n1 == a and fl1 == fla: # local unchanged - use remote 401 elif n1 == a and fl1 == fla: # local unchanged - use remote
397 if n1 == n2: # optimization: keep local content 402 if n1 == n2: # optimization: keep local content
398 actions.append((f, "e", (fl2,), "update permissions")) 403 actions.append((f, "e", (fl2,), "update permissions"))