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.
--- 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