Add Patience Differ to diff viewer.

Review Request #11239 — Created Oct. 22, 2020 and updated — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

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
./tests/runtests.py reviewboard.diffviewer.tests.test_patiencediff:PatienceDifferTest.
All unit tests have passed.

Diff Revision 3

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

orig
1
2
3
4
5
6
7
8
9
10

Commits

First Last Summary ID Author
[WIP] Add Patience Differ to diff viewer.
c9e2112bea9ba3e65aa103cfb8f5737831c276a2 Bruce Nie
Check in work done so far that will not be part of Review Board:
Added patience diff folder with jupyter notebook and some sample files insidefor testing.
ffeb1e9454cd67c12c71a1ea9449d4d6e180c4b4 Bruce Nie
Added two more parameter to indicate start index of a and b file, and modified
unit tests accordingly.
eeab960675da6c2ae7eea8f6c84059cfbec09660 Bruce Nie
Updated patiencediff to call myers with no errors, added new test cases to ch...
dbef3c32f854dfedf8de19922edaf1b46f5435dc Bruce Nie
Update patience differ test cases and added patience diff as one new differ o...
3a8a96d0518478d597cc1d1b76fb6252fa4fa4ba Bruce Nie
Removed unecessary tabs and spaces in files
36b33edda96fe5a6e6ff6851dd0fe4c760b71407 Bruce Nie
reviewboard/diffviewer/differ.py
reviewboard/diffviewer/myersdiff.py
reviewboard/diffviewer/patiencediff.py
reviewboard/diffviewer/patience_diff/Diff Algorithm Notebook.ipynb
reviewboard/diffviewer/patience_diff/LICENSE
reviewboard/diffviewer/patience_diff/README.md
reviewboard/diffviewer/patience_diff/a.py
reviewboard/diffviewer/patience_diff/b.py
reviewboard/diffviewer/patience_diff/c.txt
reviewboard/diffviewer/patience_diff/d.txt
reviewboard/diffviewer/patience_diff/new.py
reviewboard/diffviewer/patience_diff/old.py
reviewboard/diffviewer/patience_diff/patience_diff_v2.ipynb
reviewboard/diffviewer/patience_diff/.ipynb_checkpoints/Diff Algorithm Notebook-checkpoint.ipynb
reviewboard/diffviewer/patience_diff/.ipynb_checkpoints/Patience_Diff_v2-checkpoint.ipynb
reviewboard/diffviewer/tests/test_myersdiff.py
reviewboard/diffviewer/tests/test_patiencediff.py
reviewboard/notifications/webhooks.py
reviewboard/templates/forms/field.html
Loading...