changeset 15158:7ce7177e029a stable

patch: correctly handle non-tabular Subject: line The line content of continued Subject: lines was yet joined via str.replace('\n\t', ' '), which does not handle continuation via spaces. So expan the regular expression instead to handle all allowed forms of mail header line continuation.
author Steffen Daode Nurpmeso <sdaoden@googlemail.com>
date Tue, 27 Sep 2011 18:41:09 -0500
parents c208dcd0f709
children 85322c19c831 f4bc0b9e03a4
files mercurial/patch.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Fri Sep 23 09:02:27 2011 -0700
+++ b/mercurial/patch.py	Tue Sep 27 18:41:09 2011 -0500
@@ -188,7 +188,7 @@
                 pend = subject.find(']')
                 if pend >= 0:
                     subject = subject[pend + 1:].lstrip()
-            subject = subject.replace('\n\t', ' ')
+            subject = re.sub(r'\n[ \t]+', ' ', subject)
             ui.debug('Subject: %s\n' % subject)
         if user:
             ui.debug('From: %s\n' % user)