mercurial/commands.py
changeset 5230 bfd73b567b3d
parent 5224 20817af258d8
child 5266 d59ed18ec2d0
child 5298 cba2a689117d
--- a/mercurial/commands.py	Mon Aug 27 14:21:04 2007 -0300
+++ b/mercurial/commands.py	Wed Aug 29 16:15:23 2007 -0700
@@ -2338,6 +2338,14 @@
     changes = repo.status(match=names.has_key, wlock=wlock)[:5]
     modified, added, removed, deleted, unknown = map(dict.fromkeys, changes)
 
+    # if f is a rename, also revert the source
+    cwd = repo.getcwd()
+    for f in added:
+        src = repo.dirstate.copied(f)
+        if src and src not in names and repo.dirstate[src][0] == 'r':
+            removed[src] = None
+            names[src] = (repo.pathto(src, cwd), True)
+
     revert = ([], _('reverting %s\n'))
     add = ([], _('adding %s\n'))
     remove = ([], _('removing %s\n'))