# HG changeset patch # User Matt Mackall # Date 1205593351 18000 # Node ID 01aed23355e9e94c53d13b8b1e18f6838c3ea548 # Parent 14f0fe2e2db7d5e2a1303e5f8bafe57c0afe1426 merge: more simplifications to checkcopies diff -r 14f0fe2e2db7 -r 01aed23355e9 mercurial/merge.py --- a/mercurial/merge.py Sat Mar 15 10:02:31 2008 -0500 +++ b/mercurial/merge.py Sat Mar 15 10:02:31 2008 -0500 @@ -123,23 +123,18 @@ c1 = ctx(f, m1[f]) for of in _findoldnames(c1, limit): fullcopy[f] = of # remember for dir rename detection - if of not in m2: # original file not in other manifest? - if of in ma: - diverge.setdefault(of, []).append(f) - continue - # if the original file is unchanged on the other branch, - # no merge needed - if m2[of] == ma.get(of): - continue - c2 = ctx(of, m2[of]) - ca = c1.ancestor(c2) - if not ca: # unrelated? - continue - # named changed on only one side? - if ca.path() == f or ca.path() == c2.path(): - if c1 == ca and c2 == ca: # no merge needed, ignore copy - continue - copy[f] = of + if of in m2: # original file not in other manifest? + # if the original file is unchanged on the other branch, + # no merge needed + if m2[of] != ma.get(of): + c2 = ctx(of, m2[of]) + ca = c1.ancestor(c2) + # related and named changed on only one side? + if ca and ca.path() == f or ca.path() == c2.path(): + if c1 != ca or c2 != ca: # merge needed? + copy[f] = of + elif of in ma: + diverge.setdefault(of, []).append(f) if not repo.ui.configbool("merge", "followcopies", True): return {}, {}