# HG changeset patch # User Mads Kiilerich # Date 2014-11-17 00:48:43 # Node ID 5ccced6eab0be9e3479e7981687c6a0ab937fa15 # Parent 83cbf556babf1e5484fda6708eef34497d567a36 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. diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -151,6 +151,8 @@ def inserthgheader(lines, header, value) 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 diff --git a/tests/test-mq-header-date.t b/tests/test-mq-header-date.t --- a/tests/test-mq-header-date.t +++ b/tests/test-mq-header-date.t @@ -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 diff --git a/tests/test-mq-header-from.t b/tests/test-mq-header-from.t --- a/tests/test-mq-header-from.t +++ b/tests/test-mq-header-from.t @@ -250,6 +250,7 @@ 0: [mq]: 1.patch - mary ==== qref -u From: jane + Four diff -r ... 4of