changeset 16987:54295c87eefc

mq: abort if no files or revisions are specified for qimport
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 20 Jun 2012 16:22:58 +0200
parents 79902f7e27df
children f2dbe7ba11e2
files hgext/mq.py tests/test-mq-qimport.t
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Tue Jun 19 01:43:41 2012 +0200
+++ b/hgext/mq.py	Wed Jun 20 16:22:58 2012 +0200
@@ -1885,6 +1885,8 @@
                                    'files'))
             rev = scmutil.revrange(repo, rev)
             rev.sort(reverse=True)
+        elif not files:
+            raise util.Abort(_('no files or revisions specified'))
         if (len(files) > 1 or len(rev) > 1) and patchname:
             raise util.Abort(_('option "-n" not valid when importing multiple '
                                'patches'))
--- a/tests/test-mq-qimport.t	Tue Jun 19 01:43:41 2012 +0200
+++ b/tests/test-mq-qimport.t	Wed Jun 20 16:22:58 2012 +0200
@@ -22,6 +22,12 @@
   $ hg init repo
   $ cd repo
 
+qimport without file or revision
+
+  $ hg qimport
+  abort: no files or revisions specified
+  [255]
+
 qimport non-existing-file
 
   $ hg qimport non-existing-file