return str.strip('-') + '.patch'
def mbox(self):
+ postscript_re = re.compile('\n-{2,3} ?\n')
+
comment = None
try:
comment = Comment.objects.get(patch = self, msgid = self.msgid)
if comment:
body = comment.content.strip() + "\n"
+ parts = postscript_re.split(body, 1)
+ if len(parts) == 2:
+ (body, postscript) = parts
+ body = body.strip() + "\n"
+ postscript = postscript.strip() + "\n"
+ else:
+ postscript = ''
+
responses = False
for comment in Comment.objects.filter(patch = self) \
.exclude(msgid = self.msgid):
if body:
body += '\n'
- body += self.content
+ if postscript:
+ body += '---\n' + postscript.strip() + '\n'
+
+ body += '\n' + self.content
mail = PatchMbox(body)
mail['Subject'] = self.name