Commit f26f929d authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

Add comment signoffs and acks to mbox text


Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
parent 969d359e
......@@ -226,7 +226,16 @@ class Patch(models.Model):
body = ''
if comment:
body = comment.content.strip() + "\n\n"
body = comment.content.strip() + "\n"
responses = False
for comment in Comment.objects.filter(patch = self) \
.exclude(msgid = self.msgid):
body += comment.patch_responses()
if body:
body += '\n'
body += self.content
mail = MIMEText(body)
......@@ -256,6 +265,12 @@ class Comment(models.Model):
headers = models.TextField(blank = True)
content = models.TextField()
response_re = re.compile('^(Acked|Signed-off|Nacked)-by: .*$', re.M)
def patch_responses(self):
return ''.join([ match.group(0) + '\n' for match in \
self.response_re.finditer(self.content)])
class Meta:
ordering = ['date']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment