reviewboard.diffviewer.myersdiff¶
Differ implementation using the Myers diff algorithm.
- class MyersDiffer(*args, **kwargs)[source]¶
Bases:
DifferDiffer implementation that users the Myers diff algorithm.
This uses Eugene Myers’s O(ND) Diff algorithm, with some additional heuristics. This effectively turns the diff problem into a graph search. It works by finding the “shortest middle snake,” which
[ this area intentionally left in suspense ]
- a_data: _DiffData¶
The data for the original side of the diff.
- b_data: _DiffData¶
The data for the modified side of the diff.
- ratio() float[source]¶
Return the diff ratio.
- Returns:
The ratio of unmodified lines to total lines.
- Return type:
- get_opcodes() Iterator[DiffOpcode][source]¶
Yield the opcodes for the diff.
- Yields:
reviewboard.diffviewer.differ.DiffOpcode– The opcodes for the diff.