rbbz: Include full commit message when posting attachments (
bug 1232894); r?mdoglio
The old code used to use changedesc, but that doesn't seem to be set nowadays,
or at least not consistently. Use the 'description' field now, stripping off
the first line, since it's in the attachment summary.
--- a/pylib/rbbz/rbbz/extension.py
+++ b/pylib/rbbz/rbbz/extension.py
@@ -261,18 +261,29 @@ def post_bugzilla_attachment(bugzilla, b
if review.ship_it:
reviewers[last_user.email] = True
rr_url = get_obj_url(review_request)
diff_url = '%sdiff/#index_header' % rr_url
diffset_count = review_request.diffset_history.diffsets.count()
if diffset_count < 1:
- comment = 'Review commit: %s\nSee other reviews: %s' % (diff_url,
- rr_url)
+ # We don't need the first line, since it is also the attachment
+ # summary, which is displayed in the comment.
+ extended_commit_msg = review_request_draft.description.partition(
+ '\n')[2].lstrip('\n')
+
+ if extended_commit_msg:
+ extended_commit_msg += '\n\n'
+
+ comment = '%sReview commit: %s\nSee other reviews: %s' % (
+ extended_commit_msg,
+ diff_url,
+ rr_url
+ )
else:
comment = ('Review request updated; see interdiff: '
'%sdiff/%d-%d/\n' % (rr_url,
diffset_count,
diffset_count + 1))
bugzilla.post_rb_url(bug_id,
review_request.id,