[PATCH] mq: Parse commit message after we find the start of a changset patch

David Soria Parra sn_ at gmx.net
Wed Jul 29 00:56:17 CDT 2009


# HG changeset patch
# User David Soria Parra <dsp at php.net>
# Date 1248788188 -7200
# Node ID e187f31033b13d3b5c8a0abba47684dd963bad18
# Parent  f9087eea293a8d0550a5b1e9088c65c262a404f9
mq: Parse commit message after we find the start of a changset patch

patch.extract extracts just the message below HG changeset patch. So to not
parse comments above the patch, we reset the message if we find a changeset
patch as we know the commit message comes after the changeset patch data.
This is similar to the behavior of patch.extract.

The drawback of this approach, after a qref -e the comment above HG changeset
patch is gone. Without this patch the message would become part of the commit
message in the HG changset patch part.

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -105,6 +105,7 @@
                     message.append(line)
                     format = None
             elif line == '# HG changeset patch':
+                message = []
                 format = "hgpatch"
             elif (format != "tagdone" and (line.startswith("Subject: ") or
                                            line.startswith("subject: "))):


More information about the Mercurial-devel mailing list