# HG changeset patch # User Thomas Arendsen Hein # Date 2012-06-20 14:22:58 # Node ID 54295c87eefc871b806ac3c54480d1ec6f097d19 # Parent 79902f7e27df0eeae96d4d47d5c8a12fae2a0bb7 mq: abort if no files or revisions are specified for qimport diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1885,6 +1885,8 @@ class queue(object): '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')) diff --git a/tests/test-mq-qimport.t b/tests/test-mq-qimport.t --- a/tests/test-mq-qimport.t +++ b/tests/test-mq-qimport.t @@ -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