[PATCH 4/4] views: fix patch_to_mbox() for postscript

Andreas Bießmann andreas at biessmann.de
Wed Nov 20 01:44:02 EST 2013


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 <andreas at biessmann.de>
---
 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 a823388..dd307e0 100644
--- a/apps/patchwork/views/__init__.py
+++ b/apps/patchwork/views/__init__.py
@@ -173,7 +173,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 = ''
 
@@ -181,11 +181,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
-- 
1.7.10.4



More information about the Patchwork mailing list