summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-09-20 14:41:43 +1000
committerJeremy Kerr <jk@ozlabs.org>2008-09-20 14:41:43 +1000
commitf26f929de02369cf73fc8ab54fff3a046855dd9f (patch)
tree32c79a5e35bd5da3e717496a2cc064bf707c9b87 /apps
parent969d359e9c2f3eb5ee4741208ef17639d5e1b180 (diff)
downloadpatchwork-f26f929de02369cf73fc8ab54fff3a046855dd9f.tar.bz2
patchwork-f26f929de02369cf73fc8ab54fff3a046855dd9f.tar.xz
Add comment signoffs and acks to mbox text
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps')
-rw-r--r--apps/patchwork/models.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py
index d70fdb2..bf8efba 100644
--- a/apps/patchwork/models.py
+++ b/apps/patchwork/models.py
@@ -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']