diff hgext/mq.py @ 7161:b420ef2c812b

mq: abort qnew -f if any file in an explicit list cannot be read
author Brendan Cully <brendan@kublai.com>
date Sat, 18 Oct 2008 20:45:53 -0700
parents 1b7b21b634f2
children ce10a2f22258
line wrap: on
line diff
--- 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)