From 0a502d0cf5b0daced5869130b1003d2002d547ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20Bie=C3=9Fmann?= Date: Tue, 19 Nov 2013 15:44:02 +0100 Subject: [PATCH] views: fix patch_to_mbox() for postscript MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Before we changed the comment 'some comment\n---\n some/file | 1 +' to 'some comment\n\n---\nsome/file | 1 +\n'. Now we pass this comment unchanged. Signed-off-by: Andreas Bießmann Signed-off-by: Jeremy Kerr --- apps/patchwork/views/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/patchwork/views/__init__.py b/apps/patchwork/views/__init__.py index 9d1d144..dfca56d 100644 --- a/apps/patchwork/views/__init__.py +++ b/apps/patchwork/views/__init__.py @@ -181,7 +181,7 @@ def patch_to_mbox(patch): if len(parts) == 2: (body, postscript) = parts body = body.strip() + "\n" - postscript = postscript.strip() + "\n" + postscript = postscript.rstrip() else: postscript = '' @@ -189,11 +189,8 @@ def patch_to_mbox(patch): .exclude(msgid = patch.msgid): body += comment.patch_responses() - if body: - body += '\n' - if postscript: - body += '---\n' + postscript.strip() + '\n' + body += '---\n' + postscript + '\n' if patch.content: body += '\n' + patch.content -- 2.39.2