# HG changeset patch # User Brendan Cully # Date 1182812221 25200 # Node ID 487943b52a6c7931ae5ff179c1e413eee9e8fa69 # Parent 96614af3c6791ea96b296746f579a2f4eddaa309 mq: regularize patch header creation. Do not prefix qnew patches with [mq]: when a message has been given. Always use [mq]: as the prefix for generated commit messages. diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -612,11 +612,10 @@ class queue: wlock = repo.wlock() insert = self.full_series_end() if msg: - n = repo.commit(commitfiles, "[mq]: %s" % msg, force=True, - wlock=wlock) + n = repo.commit(commitfiles, msg, force=True, wlock=wlock) else: n = repo.commit(commitfiles, - "New patch: %s" % patch, force=True, wlock=wlock) + "[mq]: %s" % patch, force=True, wlock=wlock) if n == None: raise util.Abort(_("repo commit failed")) self.full_series[insert:insert] = [patch] @@ -1029,7 +1028,7 @@ class queue: if not msg: if not message: - message = "patch queue: %s\n" % patchfn + message = "[mq]: %s\n" % patchfn else: message = "\n".join(message) else: @@ -1565,7 +1564,7 @@ def new(ui, repo, patch, *args, **opts): -e, -m or -l set the patch header as well as the commit message. If none is specified, the patch header is empty and the - commit message is 'New patch: PATCH'""" + commit message is '[mq]: PATCH'""" q = repo.mq message = cmdutil.logmessage(opts) if opts['edit']: diff --git a/tests/test-mq-qdelete.out b/tests/test-mq-qdelete.out --- a/tests/test-mq-qdelete.out +++ b/tests/test-mq-qdelete.out @@ -12,12 +12,12 @@ a b series status -1 New patch: a +1 [mq]: a 0 base abort: cannot delete revision 3 above applied patches f -4 New patch: f -3 New patch: e -2 New patch: d -1 New patch: a +4 [mq]: f +3 [mq]: e +2 [mq]: d +1 [mq]: a 0 base