diff hgext/mq.py @ 23344:6333412245ec stable

mq: when setting message in plain mode, separate it from header (issue4453) Fix inconsistent handling of plain header separation in mq patcheader - and contrary to c87f2a5a6e49, do it in the direction of having an empty line between header and description. Plain patches are like mails and should thus have an empty line between headers and body in compliance with RFC 822 3.1.
author Mads Kiilerich <madski@unity3d.com>
date Sun, 16 Nov 2014 19:57:40 +0100
parents b6f7cf47f5d1
children 83cbf556babf
line wrap: on
line diff
--- a/hgext/mq.py	Tue Nov 11 17:25:09 2014 -0600
+++ b/hgext/mq.py	Sun Nov 16 19:57:40 2014 +0100
@@ -293,7 +293,10 @@
         if self.comments:
             self._delmsg()
         self.message = [message]
-        self.comments += self.message
+        if message:
+            if self.plainmode and self.comments and self.comments[-1]:
+                self.comments.append('')
+            self.comments.append(message)
 
     def updateheader(self, prefixes, new):
         '''Update all references to a field in the patch header.