findcopies: shortcut for empty working dir
authorMatt Mackall <mpm@selenic.com>
Tue, 26 Sep 2006 15:58:51 -0500
changeset 3161 1839e6e91c3a
parent 3159 e43fd1623fe1
child 3162 84561ea8711e
findcopies: shortcut for empty working dir
mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -133,6 +133,10 @@ def findcopies(repo, m1, m2, limit):
     Find moves and copies between m1 and m2 back to limit linkrev
     """
 
+    # avoid silly behavior for update from empty dir
+    if not m1:
+        return {}
+
     dcopies = repo.dirstate.copies()
     copy = {}
     match = {}