changeset 6648:2519976a998b

mq: handle added patch renaming correctly
author Weijun Wang <weijun.wang@sun.com>
date Fri, 06 Jun 2008 18:23:31 +0200
parents d90d83ebea9e
children 05a682c8907d
files hgext/mq.py
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Tue Jun 03 12:10:14 2008 +0200
+++ b/hgext/mq.py	Fri Jun 06 18:23:31 2008 +0200
@@ -2011,10 +2011,14 @@
     if r:
         wlock = r.wlock()
         try:
-            if r.dirstate[name] == 'r':
-                r.undelete([name])
-            r.copy(patch, name)
-            r.remove([patch], False)
+            if r.dirstate[patch] == 'a':
+                r.dirstate.forget(patch)
+                r.dirstate.add(name)
+            else:
+                if r.dirstate[name] == 'r':
+                    r.undelete([name])
+                r.copy(patch, name)
+                r.remove([patch], False)
         finally:
             del wlock