mq: don't fail when removing a patch without patch file from series file
authorMads Kiilerich <mads@kiilerich.com>
Sun, 09 Dec 2012 00:25:21 +0100
changeset 18067 6f62e005781d
parent 18066 abe9799a86d6
child 18068 4bec77e62c00
mq: don't fail when removing a patch without patch file from series file
hgext/mq.py
tests/test-mq.t
--- a/hgext/mq.py	Thu Dec 13 19:19:06 2012 +0100
+++ b/hgext/mq.py	Sun Dec 09 00:25:21 2012 +0100
@@ -827,7 +827,11 @@
             if r:
                 r[None].forget(patches)
             for p in patches:
-                os.unlink(self.join(p))
+                try:
+                    os.unlink(self.join(p))
+                except OSError, inst:
+                    if inst.errno != errno.ENOENT:
+                        raise
 
         qfinished = []
         if numrevs:
--- a/tests/test-mq.t	Thu Dec 13 19:19:06 2012 +0100
+++ b/tests/test-mq.t	Sun Dec 09 00:25:21 2012 +0100
@@ -1110,8 +1110,14 @@
   $ hg qpop
   popping baz
   now at: bar
+
+test qdel/qrm
+
   $ hg qdel baz
-
+  $ echo p >> .hg/patches/series
+  $ hg qrm p
+  $ hg qser
+  bar
 
 create a git patch