Comment serialization cleanup part 6: Fix terrible DiffFile names

Review Request #13660 — Created March 21, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

The DiffFile model (and the files context key when rendering
diffviewer templates) still used variable names from the very first days
of Review Board, when we used a fair bit of Perforce terminology.

This change fixes that to use orig_filename, orig_revision,
modified_filename, and modified_revision. This is a breaking change,
but I think that's okay for two reasons:

  1. The DiffFile model is pretty much an implementation detail of our
    diffviewer UI. It seems extremely unlikely that anybody would be
    digging into this.
  2. The documentation inside DiffFile was quite incorrect for many of
    the attributes. This was fixed in a prior change, but reinforces my
    belief that nobody was using it.

Ran python tests.
Ran js-tests.

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

orig
1
2
3

Commits

First Last Summary ID Author
Comment serialization cleanup part 6: Fix terrible DiffFile names
The DiffFile model (and the `files` context key when rendering diffviewer templates) still used variable names from the very first days of Review Board, when we used a fair bit of Perforce terminology. This change fixes that to use `orig_filename`, `orig_revision`, `modified_filename`, and `modified_revision`. This is a breaking change, but I think that's okay for two reasons: 1. The `DiffFile` model is pretty much an implementation detail of our diffviewer UI. It seems extremely unlikely that anybody would be digging into this. 2. The documentation inside `DiffFile` was quite incorrect for many of the attributes. This was fixed in a prior change, but reinforces my belief that nobody was using it. Testing Done: Ran python tests. Ran js-tests.
493987e97a9b36abdd91b6dbb5bb9849c20c1ca1 David Trowbridge
reviewboard/diffviewer/diffutils.py
reviewboard/diffviewer/tests/test_diffutils.py
reviewboard/reviews/tests/test_reviews_diff_viewer_view.py
reviewboard/reviews/views/diff_fragments.py
reviewboard/reviews/views/diffviewer.py
reviewboard/static/rb/js/reviews/models/diffFileModel.ts
reviewboard/static/rb/js/reviews/models/tests/diffFileModelTests.ts
reviewboard/static/rb/js/reviews/views/diffFileIndexView.ts
reviewboard/static/rb/js/reviews/views/diffViewerPageView.ts
reviewboard/templates/diffviewer/diff_file_fragment.html
reviewboard/templates/diffviewer/diff_fragment_error_base.html
Loading...