changeset 4736:04b2c1e27c26

mq: require patch argument or revision for qdelete
author Brendan Cully <brendan@kublai.com>
date Thu, 28 Jun 2007 08:42:43 -0700
parents 8d4fac0a9df7
children 2ececafa5859
files hgext/mq.py tests/test-mq-qdelete tests/test-mq-qdelete.out
diffstat 3 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Thu Jun 28 16:18:09 2007 +0200
+++ b/hgext/mq.py	Thu Jun 28 08:42:43 2007 -0700
@@ -532,6 +532,9 @@
         return (err, n)
 
     def delete(self, repo, patches, opts):
+        if not patches and not opts.get('rev'):
+            raise util.Abort(_('missing patch name'))
+
         realpatches = []
         for patch in patches:
             patch = self.lookup(patch, strict=True)
--- a/tests/test-mq-qdelete	Thu Jun 28 16:18:09 2007 +0200
+++ b/tests/test-mq-qdelete	Thu Jun 28 08:42:43 2007 -0700
@@ -13,6 +13,8 @@
 hg qnew b
 hg qnew c
 
+hg qdel
+
 hg qdel c
 hg qpop
 hg qdel c
--- a/tests/test-mq-qdelete.out	Thu Jun 28 16:18:09 2007 +0200
+++ b/tests/test-mq-qdelete.out	Thu Jun 28 08:42:43 2007 -0700
@@ -1,4 +1,5 @@
 adding base
+abort: missing patch name
 abort: cannot delete applied patch c
 Now at: b
 a