# HG changeset patch # User Weijun Wang # Date 1212769411 -7200 # Node ID 2519976a998b7cb02dd92907992cb9f94f4b837f # Parent d90d83ebea9ee988bf3fe681ccb061611800acf8 mq: handle added patch renaming correctly diff -r d90d83ebea9e -r 2519976a998b hgext/mq.py --- 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