mercurial/cmdutil.py
changeset 18853 78d760aa3607
parent 18852 300844cb1a56
child 18909 3a72c89a83ec
--- a/mercurial/cmdutil.py	Thu Mar 28 00:14:27 2013 -0700
+++ b/mercurial/cmdutil.py	Thu Mar 28 18:27:19 2013 -0700
@@ -1593,7 +1593,10 @@
 def duplicatecopies(repo, rev, fromrev):
     '''reproduce copies from fromrev to rev in the dirstate'''
     for dst, src in copies.pathcopies(repo[fromrev], repo[rev]).iteritems():
-        repo.dirstate.copy(src, dst)
+        # copies.pathcopies returns backward renames, so dst might not
+        # actually be in the dirstate
+        if repo.dirstate[dst] in "nma":
+            repo.dirstate.copy(src, dst)
 
 def commit(ui, repo, commitfunc, pats, opts):
     '''commit the specified files or all outstanding changes'''