merge: move check for empty ancestor into findcopies
authorMatt Mackall <mpm@selenic.com>
Thu, 30 Nov 2006 17:36:33 -0600
changeset 3731 b4af5f92e04b
parent 3730 d377f8d25662
child 3732 ffe9fef84801
merge: move check for empty ancestor into findcopies
mercurial/merge.py
--- a/mercurial/merge.py	Thu Nov 30 17:36:33 2006 -0600
+++ b/mercurial/merge.py	Thu Nov 30 17:36:33 2006 -0600
@@ -125,7 +125,7 @@
         return {}
 
     # avoid silly behavior for update from empty dir
-    if not m1:
+    if not m1 or not m2 or not ma:
         return {}
 
     dcopies = repo.dirstate.copies()
@@ -188,7 +188,7 @@
         repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m))
         action.append((f, m) + args)
 
-    if pa and not (backwards or overwrite):
+    if not (backwards or overwrite):
         copy = findcopies(repo, m1, m2, ma, pa.rev())
     copied = dict.fromkeys(copy.values())