changeset 18067:6f62e005781d

mq: don't fail when removing a patch without patch file from series file
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 09 Dec 2012 00:25:21 +0100
parents abe9799a86d6
children 4bec77e62c00
files hgext/mq.py tests/test-mq.t
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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