Add Patience Differ to diff viewer.
Review Request #11239 — Created Oct. 22, 2020 and updated — Latest diff uploaded
Review Board uses a version of the Meyers Diff algorithm for the diff viewer,
which is pretty standard and widely-used. However, unclear diff might be
reported under some scenarios. For example, when user switched order of a big
chunk of code with each other, meyer diff will see it as a change line by line
instead of being aware that the whole block is switched. Patience differ
tackles issues like these by scanning the whole file and actively seeking out
interesting lines before applying diff while sacrificing some performances.
This is a backend feature and it has not been updated to be the default method
of diffing. To test this feature, you could go to
reviewboard/diffviewer/differ.py, and update line 26 to
DEFAULT = PATIENCE.
Unit tests are created in reviewboard/diffviewer/tests/test_patiencediff.py.
You can run the test by
All unit tests have passed.