Show diffs for text file attachments.

Review Request #7123 — Created March 25, 2015 and submitted — Latest diff uploaded

Information

Review Board
release-2.5.x
6cb3753...

Reviewers

When viewing diffs of text file attachments, they're now rendered as if
they were actual diffs. We use the same diff chunk generation and
rendering logic, and commenting abilities.

This carries over to renderable text files as well. Rendered Markdown is
diffed as well. We even show the changes within lines, though only
text changes and not formatting.

Comment thumbnails are shown based on the render state. The thumbnails
show the diffed contents just like for actual diff comments.

Some of the diff-specific JavaScript code is now made more
general-purpose, and lives in TextCommentRowSelector. This is primarily
the row finding code. There's also a convenience function around it for
finding the beginning and end rows for a line range, needed for both the
diff viewer and the text attachment review UI.

Tested viewing individual revisions and revision ranges for various text
files and for Markdown files (rendered and source).

Tested commenting on lines within these, both single lines and spanning
multiple lines. I checked commenting on the first line and last lines of
the files, to test boundary issues.

Tested that the thumbnails matched the right lines and the right view mode
for plain text and Markdown, on both the review dialog and the reviews.