Fix computation of new-file state with commit ranges.

Review Request #13674 — Created March 28, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

When selecting a range of commits where the first commit adds a file and
the later commit(s) change it, the is_new_file state was being
incorrectly computed as True. In the case where we have a base
filediff, we instead should be treating it as an existing file rather
than a new one.

Loaded a commit range that was previously triggering the bug (especially
noticeable with the way binary files were loaded). Saw that I was now
seeing it treated as an existing file rather than new.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Fix computation of new-file state with commit ranges.
When selecting a range of commits where the first commit adds a file and the later commit(s) change it, the `is_new_file` state was being incorrectly computed as `True`. In the case where we have a base filediff, we instead should be treating it as an existing file rather than a new one. Testing Done: Loaded a commit range that was previously triggering the bug (especially noticeable with the way binary files were loaded). Saw that I was now seeing it treated as an existing file rather than new.
2410a01f205ffbe9a31848d4b08968dcd24f9d05 David Trowbridge
reviewboard/diffviewer/diffutils.py
reviewboard/diffviewer/tests/test_diffutils.py
Loading...