mq: when adding headers in plain mode, separate them from message (issue4453) stable
authorMads Kiilerich <madski@unity3d.com>
Mon, 17 Nov 2014 01:48:43 +0100
branchstable
changeset 23346 5ccced6eab0b
parent 23345 83cbf556babf
child 23350 e63941631a3f
child 23376 2e65da5f80df
mq: when adding headers in plain mode, separate them from message (issue4453) c87f2a5a6e49 did a clean-up in one direction ... but we want it in the other direction.
hgext/mq.py
tests/test-mq-header-date.t
tests/test-mq-header-from.t
--- a/hgext/mq.py	Mon Nov 17 01:48:19 2014 +0100
+++ b/hgext/mq.py	Mon Nov 17 01:48:43 2014 +0100
@@ -151,6 +151,8 @@
     return lines
 
 def insertplainheader(lines, header, value):
+    if lines and lines[0] and ':' not in lines[0]:
+        lines.insert(0, '')
     lines.insert(0, '%s: %s' % (header, value))
     return lines
 
--- a/tests/test-mq-header-date.t	Mon Nov 17 01:48:19 2014 +0100
+++ b/tests/test-mq-header-date.t	Mon Nov 17 01:48:43 2014 +0100
@@ -311,6 +311,7 @@
   0: [mq]: 1.patch - test
   ==== qref -d
   Date: 9 0
+  
   Four
   
   diff -r ... 4
@@ -494,6 +495,7 @@
   ==== qref -u -d
   Date: 15 0
   From: john
+  
   Nine
   
   diff -r ... 9
--- a/tests/test-mq-header-from.t	Mon Nov 17 01:48:19 2014 +0100
+++ b/tests/test-mq-header-from.t	Mon Nov 17 01:48:43 2014 +0100
@@ -250,6 +250,7 @@
   0: [mq]: 1.patch - mary
   ==== qref -u
   From: jane
+  
   Four
   
   diff -r ... 4of