Add line numbers to reviews in text emails.
Review Request #6864 — Created Jan. 31, 2015 and submitted — Latest diff uploaded
When a review has comments on the source code, text email notifications only show the files that have been changed, while HTML email notifications show the diff view. This change adds the line numbers of the patched files that have been commented on in a review to the email text body.
Now, the line numbers are shown as follows:
<file name> (Lines 18 - 25)
A new template tag has been implemented to render the line numbers of the code that have been commented on. It will render singular "Line" or plural "Lines" or none depending on the changes.
In reviewboard/reviews/views.py, we have added and exposed the
chunks
attribute to each comment entry withincomment_entries
. Also, the text email template will now make use of this new exposed attribute to render the individual commented files with line number information in each review.While testing this, we found a new bug:
https://code.google.com/p/reviewboard/issues/detail?id=3748
No unit tests have been written.
Manual testing has been conducted:
When no lines are selected in a review, nothing is affected.
When a range of lines over multiple chunks are selected, the line numbers display properly.
Chunks which have been deleted will not have their original line numbers shown, only line numbers in the patched file will be shown.