diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -655,6 +655,10 @@ class queue: raise util.Abort(_('patch "%s" already exists') % patch) if opts.get('include') or opts.get('exclude') or pats: match = cmdutil.match(repo, pats, opts) + # detect missing files in pats + def badfn(f, msg): + raise util.Abort('%s: %s' % (f, msg)) + match.bad = badfn m, a, r, d = repo.status(match=match)[:4] else: m, a, r, d = self.check_localchanges(repo, force) diff --git a/tests/test-mq b/tests/test-mq --- a/tests/test-mq +++ b/tests/test-mq @@ -99,14 +99,8 @@ hg qnew uncommitted.patch hg st hg qseries -echo '% qnew with uncommitted changes and missing file (issue 803)' - -hg qnew issue803.patch someotherfile 2>&1 | \ - sed -e 's/someotherfile:.*/someotherfile: No such file or directory/' -hg st -hg qseries -hg qpop -f -hg qdel issue803.patch +echo '% qnew missing' +hg qnew missing.patch missing hg revert --no-backup somefile rm somefile diff --git a/tests/test-mq.out b/tests/test-mq.out --- a/tests/test-mq.out +++ b/tests/test-mq.out @@ -99,12 +99,8 @@ B % qnew with uncommitted changes abort: local changes found, refresh first A somefile -% qnew with uncommitted changes and missing file (issue 803) -someotherfile: No such file or directory -someotherfile: No such file or directory -A somefile -issue803.patch -Patch queue now empty +% qnew missing +abort: missing: No such file or directory % qnew -m foo bar % qrefresh