diff mercurial/cmdutil.py @ 23404:b913c394386f

merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 27 Nov 2014 12:25:01 -0600
parents d8cdd46f426d edf29f9c15f0
children 341e4798c24d
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue Nov 11 20:32:10 2014 -0800
+++ b/mercurial/cmdutil.py	Thu Nov 27 12:25:01 2014 -0600
@@ -2615,12 +2615,16 @@
             dsmodified = modified
             dsadded = added
             dsremoved = removed
+            # store all local modifications, useful later for rename detection
+            localchanges = dsmodified | dsadded
             modified, added, removed = set(), set(), set()
         else:
             changes = repo.status(node1=parent, match=m)
             dsmodified = set(changes.modified)
             dsadded    = set(changes.added)
             dsremoved  = set(changes.removed)
+            # store all local modifications, useful later for rename detection
+            localchanges = dsmodified | dsadded
 
             # only take into account for removes between wc and target
             clean |= dsremoved - removed
@@ -2654,7 +2658,7 @@
 
         # if f is a rename, update `names` to also revert the source
         cwd = repo.getcwd()
-        for f in dsadded:
+        for f in localchanges:
             src = repo.dirstate.copied(f)
             # XXX should we check for rename down to target node?
             if src and src not in names and repo.dirstate[src] == 'r':