Fix interdiffs when comparing revisions with stripped-slash filenames.
Review Request #6272 — Created Aug. 26, 2014 and submitted
The leading-slash stripping code strikes again. In this case, an initial
revision of a diff was uploaded prior to an upgrade, and a new version was
uploaded subsequent. The result is that the filenames don't match exactly
because one has leading slashes and the other doesn't.This change normalizes the filenames to always compare them without leading
slashes when figuring out which files match up with which.
Created two diff revisions and changed the FileDiffs in the database so that
the first one had leading slashes and the second didn't. Before this change, I
see two entries in the interdiff for that file. After, it shows the correct
interdiff.Tested all permutations of leading slash/no leading slash in interdiff
combinations.
-
-
reviewboard/diffviewer/diffutils.py (Diff revision 1) The other normalization code only removes the first slash. We should be consistent.
Actually, can we just grab the diff parser from the repository's tool and call
normalize_diff_filenames()
on it, instead of re-implementing this logic?
Testing Done: |
|
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
|||||||||||||||||||||
Diff: |
Revision 2 (+12 -3) |