Store insert/deleted line counts along with diffs.
Review Request #3816 — Created Jan. 30, 2013 and submitted
Store insert/deleted line counts along with diffs. When parsing a diff, we now keep track of the inserted/deleted line counts and store them in the resulting file info. This is then stored in the FileDiffData for a diff blob. We'll be able to use this later to display a nice visualization of how many lines were added/removed. When accessing line counts for older diffs, the diff will be migrated to a FileDiffData (if needed) and line counts will be recomputed by re-parsing the stored diff and pulling out those counts. Unit tests were added to test parsing these for standard diffs and git diffs (which does a bunch of custom parsing).
All unit tests pass. I uploaded some diffs and checked that the correct values were stored in the FileDiffData. I made sure the recalculate code wasn't being called for these tests. I then loaded up some older diffs (some in the diff viewer first, some just in the admin UI) and saw the correct counts. I checked that the recalculate code was being called here (and migration in some cases).
- Change Summary:
-
Added the missing evolution file.
- Diff:
-
Revision 2 (+362 -25)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/parser.py reviewboard/scmtools/git.py reviewboard/diffviewer/evolutions/filediffdata_line_counts.py reviewboard/diffviewer/models.py reviewboard/scmtools/tests.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/evolutions/__init__.py reviewboard/diffviewer/forms.py Ignored Files:
-
It looks like the parent branch wasn't set correctly when you posted this--I see parts of other changes in here.
- Change Summary:
-
Fixed the diff.
- Diff:
-
Revision 3 (+268 -18)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/parser.py reviewboard/scmtools/git.py reviewboard/diffviewer/evolutions/filediffdata_line_counts.py reviewboard/diffviewer/models.py reviewboard/scmtools/tests.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/evolutions/__init__.py reviewboard/diffviewer/forms.py Ignored Files: