diff mercurial/cmdutil.py @ 19129:bd19587a3347 stable

revert: ensure that copies and renames are honored (issue3920) Previously, we restored the states of files, but not the additional information the dirstate uses to track copies and renames.
author Bryan O'Sullivan <bryano@fb.com>
date Fri, 03 May 2013 12:40:17 -0700
parents ab04e87a5f3b
children 3bfd7f1e7485
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Fri May 03 09:44:50 2013 -0700
+++ b/mercurial/cmdutil.py	Fri May 03 12:40:17 2013 -0700
@@ -2055,6 +2055,12 @@
                 checkout(f)
                 normal(f)
 
+            copied = copies.pathcopies(repo[parent], ctx)
+
+            for f in add[0] + undelete[0] + revert[0]:
+                if f in copied:
+                    repo.dirstate.copy(copied[f], f)
+
             if targetsubs:
                 # Revert the subrepos on the revert list
                 for sub in targetsubs: