# HG changeset patch # User Matt Mackall # Date 1184625034 18000 # Node ID f24191a5d45aec087f63fd6a39230c313287d3c8 # Parent 2f09df302f30bab25b29e5cc835e99170c63f936# Parent 931f901ab811361aaf0b8b7dd84937a849e31841 Merge with -stable diff -r 2f09df302f30 -r f24191a5d45a mercurial/merge.py --- a/mercurial/merge.py Mon Jul 16 14:43:47 2007 -0700 +++ b/mercurial/merge.py Mon Jul 16 17:30:34 2007 -0500 @@ -157,7 +157,7 @@ fullcopy = {} diverge = {} - def checkcopies(c, man): + def checkcopies(c, man, aman): '''check possible copies for filectx c''' for of in findold(c): fullcopy[c.path()] = of # remember for dir rename detection @@ -165,6 +165,10 @@ if of in ma: diverge.setdefault(of, []).append(c.path()) continue + # if the original file is unchanged on the other branch, + # no merge needed + if man[of] == aman.get(of): + continue c2 = ctx(of, man[of]) ca = c.ancestor(c2) if not ca: # unrelated? @@ -186,10 +190,10 @@ u2 = nonoverlap(m2, m1, ma) for f in u1: - checkcopies(ctx(f, m1[f]), m2) + checkcopies(ctx(f, m1[f]), m2, ma) for f in u2: - checkcopies(ctx(f, m2[f]), m1) + checkcopies(ctx(f, m2[f]), m1, ma) d2 = {} for of, fl in diverge.items(): @@ -197,7 +201,6 @@ fo = list(fl) fo.remove(f) d2[f] = (of, fo) - #diverge = d2 if not fullcopy or not repo.ui.configbool("merge", "followdirs", True): return copy, diverge