diffviewer: highlight all same-line changes (bug 1224733); r=smacleod
authorbyron jones <glob@mozilla.com>
Mon, 21 Nov 2016 15:58:30 +0800
changeset 48 b80eef4c95110ea3918e45d7ede4e0f23e19c6c6
parent 47 50788ce68e0da6378d9843c85f76408ebd7d59ac
child 49 c4124cae0efdc97542035251e6a599997147c997
push id26
push userbjones@mozilla.com
push dateMon, 21 Nov 2016 17:37:09 +0000
reviewerssmacleod
bugs1224733
diffviewer: highlight all same-line changes (bug 1224733); r=smacleod Always highlight same-line changes, instead of representing the line as unchanged. MozReview-Commit-ID: EY5ZT3vmQjK
reviewboard/reviewboard/diffviewer/diffutils.py
--- a/reviewboard/reviewboard/diffviewer/diffutils.py
+++ b/reviewboard/reviewboard/diffviewer/diffutils.py
@@ -717,18 +717,19 @@ def get_line_changed_regions(oldline, ne
     differ = SequenceMatcher(None, oldline, newline)
 
     # This thresholds our results -- we don't want to show inter-line diffs
     # if most of the line has changed, unless those lines are very short.
 
     # FIXME: just a plain, linear threshold is pretty crummy here.  Short
     # changes in a short line get lost.  I haven't yet thought of a fancy
     # nonlinear test.
-    if differ.ratio() < 0.6:
-        return None, None
+
+    # MozReview: Ignore the last two paragraphs - we always want to show all
+    # changes, so the ratio based logic has been removed.
 
     oldchanges = []
     newchanges = []
     back = (0, 0)
 
     for tag, i1, i2, j1, j2 in differ.get_opcodes():
         if tag == 'equal':
             if (i2 - i1 < 3) or (j2 - j1 < 3):