[WIP] Add Patience Differ to diff viewer.

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

bnie
Review Board
release-4.0.x
reviewboard

[WIP] Add Patience Differ to diff viewer.

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 WIP request with all of the work I've done so far checked in, including two jupyter notebooks (patience_diff_v2 is the most updated one), some sample files for diff tests, and a py file containing my attempt to integrate patiencediff into RB.

Summary
[WIP] Add Patience Differ to diff viewer.
Check in work done so far that will not be part of Review Board:
Added two more parameter to indicate start index of a and b file, and modified
Updated patiencediff to call myers with no errors, added new test cases to check if the correct result is returned, so far the tests do not pass.
Update patience differ test cases and added patience diff as one new differ option in differ class.
Removed unecessary tabs and spaces in files
Updated PatienceDiffer tests and added new functions to pre-process code blocks
Description From Last Updated

E231 missing whitespace after ','

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F821 undefined name 'csv'

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

F821 undefined name 'os'

reviewbotreviewbot

E261 at least two spaces before inline comment

reviewbotreviewbot

F821 undefined name 'argparse'

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E501 line too long (84 > 79 characters)

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E501 line too long (107 > 79 characters)

reviewbotreviewbot

F821 undefined name 'get_filenames'

reviewbotreviewbot

F821 undefined name 'read_input'

reviewbotreviewbot

F821 undefined name 'find_match'

reviewbotreviewbot

F821 undefined name 'rm_duplicate'

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E226 missing whitespace around arithmetic operator

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E305 expected 2 blank lines after class or function definition, found 1

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F821 undefined name 'csv'

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E303 too many blank lines (3)

reviewbotreviewbot

F821 undefined name 'os'

reviewbotreviewbot

E261 at least two spaces before inline comment

reviewbotreviewbot

F821 undefined name 'argparse'

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F821 undefined name 'csv'

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

F821 undefined name 'os'

reviewbotreviewbot

E261 at least two spaces before inline comment

reviewbotreviewbot

F821 undefined name 'argparse'

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E501 line too long (84 > 79 characters)

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E501 line too long (107 > 79 characters)

reviewbotreviewbot

F821 undefined name 'get_filenames'

reviewbotreviewbot

F821 undefined name 'read_input'

reviewbotreviewbot

F821 undefined name 'find_match'

reviewbotreviewbot

F821 undefined name 'rm_duplicate'

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E226 missing whitespace around arithmetic operator

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E305 expected 2 blank lines after class or function definition, found 1

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F821 undefined name 'csv'

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E303 too many blank lines (3)

reviewbotreviewbot

F821 undefined name 'os'

reviewbotreviewbot

E261 at least two spaces before inline comment

reviewbotreviewbot

F821 undefined name 'argparse'

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F821 undefined name 'csv'

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

F821 undefined name 'os'

reviewbotreviewbot

E261 at least two spaces before inline comment

reviewbotreviewbot

F821 undefined name 'argparse'

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E501 line too long (84 > 79 characters)

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E501 line too long (107 > 79 characters)

reviewbotreviewbot

F821 undefined name 'get_filenames'

reviewbotreviewbot

F821 undefined name 'read_input'

reviewbotreviewbot

F821 undefined name 'find_match'

reviewbotreviewbot

F821 undefined name 'rm_duplicate'

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E226 missing whitespace around arithmetic operator

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E305 expected 2 blank lines after class or function definition, found 1

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F821 undefined name 'csv'

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E303 too many blank lines (3)

reviewbotreviewbot

F821 undefined name 'os'

reviewbotreviewbot

E261 at least two spaces before inline comment

reviewbotreviewbot

F821 undefined name 'argparse'

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F821 undefined name 'csv'

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

F821 undefined name 'os'

reviewbotreviewbot

E261 at least two spaces before inline comment

reviewbotreviewbot

F821 undefined name 'argparse'

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E501 line too long (84 > 79 characters)

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E501 line too long (107 > 79 characters)

reviewbotreviewbot

F821 undefined name 'get_filenames'

reviewbotreviewbot

F821 undefined name 'read_input'

reviewbotreviewbot

F821 undefined name 'find_match'

reviewbotreviewbot

F821 undefined name 'rm_duplicate'

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E226 missing whitespace around arithmetic operator

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E305 expected 2 blank lines after class or function definition, found 1

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F821 undefined name 'csv'

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E303 too many blank lines (3)

reviewbotreviewbot

F821 undefined name 'os'

reviewbotreviewbot

E261 at least two spaces before inline comment

reviewbotreviewbot

F821 undefined name 'argparse'

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

bnie
Review request changed

Change Summary:

Updated patiencediff to call myers with no errors, added new test cases to check if the correct result is returned, so far the tests do not pass.

Commits:

Summary
-
[WIP] Add Patience Differ to diff viewer.
-
Check in work done so far that will not be part of Review Board:
+
[WIP] Add Patience Differ to diff viewer.
+
Check in work done so far that will not be part of Review Board:
+
Added two more parameter to indicate start index of a and b file, and modified
+
Updated patiencediff to call myers with no errors, added new test cases to check if the correct result is returned, so far the tests do not pass.

Diff:

Revision 2 (+4690 -46)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

bnie
Review request changed

Commits:

Summary
-
[WIP] Add Patience Differ to diff viewer.
-
Check in work done so far that will not be part of Review Board:
-
Added two more parameter to indicate start index of a and b file, and modified
-
Updated patiencediff to call myers with no errors, added new test cases to check if the correct result is returned, so far the tests do not pass.
+
[WIP] Add Patience Differ to diff viewer.
+
Check in work done so far that will not be part of Review Board:
+
Added two more parameter to indicate start index of a and b file, and modified
+
Updated patiencediff to call myers with no errors, added new test cases to check if the correct result is returned, so far the tests do not pass.
+
Update patience differ test cases and added patience diff as one new differ option in differ class.
+
Removed unecessary tabs and spaces in files

Diff:

Revision 3 (+4761 -83)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

bnie
Review request changed

Commits:

Summary
-
[WIP] Add Patience Differ to diff viewer.
-
Check in work done so far that will not be part of Review Board:
-
Added two more parameter to indicate start index of a and b file, and modified
-
Updated patiencediff to call myers with no errors, added new test cases to check if the correct result is returned, so far the tests do not pass.
-
Update patience differ test cases and added patience diff as one new differ option in differ class.
-
Removed unecessary tabs and spaces in files
+
[WIP] Add Patience Differ to diff viewer.
+
Check in work done so far that will not be part of Review Board:
+
Added two more parameter to indicate start index of a and b file, and modified
+
Updated patiencediff to call myers with no errors, added new test cases to check if the correct result is returned, so far the tests do not pass.
+
Update patience differ test cases and added patience diff as one new differ option in differ class.
+
Removed unecessary tabs and spaces in files
+
Updated PatienceDiffer tests and added new functions to pre-process code blocks

Diff:

Revision 4 (+5106 -922)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

Loading...