changeset 4722:487943b52a6c

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.
author Brendan Cully <brendan@kublai.com>
date Mon, 25 Jun 2007 15:57:01 -0700
parents 96614af3c679
children fb4b6d5fe100
files hgext/mq.py tests/test-mq-qdelete.out
diffstat 2 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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']:
--- 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