--- a/hgext/mq.py Tue May 24 19:16:51 2011 +0300
+++ b/hgext/mq.py Tue May 24 19:17:02 2011 +0300
@@ -892,7 +892,8 @@
if date:
date = util.parsedate(date)
diffopts = self.diffopts({'git': opts.get('git')})
- self.checkpatchname(patchfn)
+ if opts.get('checkname', True):
+ self.checkpatchname(patchfn)
inclsubs = self.check_substate(repo)
if inclsubs:
inclsubs.append('.hgsubstate')
--- a/hgext/record.py Tue May 24 19:16:51 2011 +0300
+++ b/hgext/record.py Tue May 24 19:17:02 2011 +0300
@@ -389,7 +389,10 @@
except KeyError:
raise util.Abort(_("'mq' extension not loaded"))
+ repo.mq.checkpatchname(patch)
+
def committomq(ui, repo, *pats, **opts):
+ opts['checkname'] = False
mq.new(ui, repo, patch, *pats, **opts)
dorecord(ui, repo, committomq, 'qnew', *pats, **opts)
--- a/tests/test-qrecord.t Tue May 24 19:16:51 2011 +0300
+++ b/tests/test-qrecord.t Tue May 24 19:17:02 2011 +0300
@@ -219,6 +219,12 @@
someone
up
+qrecord with bad patch name, should abort before prompting
+
+ $ hg qrecord .hg
+ abort: patch name cannot begin with ".hg"
+ [255]
+
qrecord a.patch
$ hg qrecord -d '0 0' -m aaa a.patch <<EOF