# HG changeset patch # User Brendan Cully # Date 1224387953 25200 # Node ID b420ef2c812b5b790d4982fc4edca06b8f4952f4 # Parent 1b7b21b634f263505735826c477a0fbd6318e565 mq: abort qnew -f if any file in an explicit list cannot be read diff -r 1b7b21b634f2 -r b420ef2c812b hgext/mq.py --- a/hgext/mq.py Sat Oct 18 17:29:45 2008 -0700 +++ b/hgext/mq.py Sat Oct 18 20:45:53 2008 -0700 @@ -655,6 +655,10 @@ 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 -r 1b7b21b634f2 -r b420ef2c812b tests/test-mq --- a/tests/test-mq Sat Oct 18 17:29:45 2008 -0700 +++ b/tests/test-mq Sat Oct 18 20:45:53 2008 -0700 @@ -99,14 +99,8 @@ 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 -r 1b7b21b634f2 -r b420ef2c812b tests/test-mq.out --- a/tests/test-mq.out Sat Oct 18 17:29:45 2008 -0700 +++ b/tests/test-mq.out Sat Oct 18 20:45:53 2008 -0700 @@ -99,12 +99,8 @@ % 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