Comment serialization cleanup part 6: Fix terrible DiffFile names

Review Request #13660 — Created March 22, 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 3 (Latest)

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.
c3569256e79e4322448ac3bd5165f09f675e0ed8 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...