Fix determining the beginning of move ranges.

Review Request #8798 - Created March 6, 2017 and submitted

Christian Hammond
Review Board
release-2.5.x
748fe39...
reviewboard
When the latest generation of the move detection code was written, it
was able to properly determine the beginning of move ranges when
adjacent to other move ranges coming from different lines. For instance,
if 5 lines were moved, but the first 2 were reorderd to be placed after
the last 3, the move detection code would notice this and show this as
two separate move range.

Somewhere along the line, this regressed, and the move detection code
was seeing this as one single move. That's a bit misleading, since while
the code has moved, the order did not remain the same.

This change fixes this by improving the logic for determining the
beginning of a move range, and adding unit tests to ensure it works as
expected.

Unit tests pass.

Tested manually with a review request I have that moves a few lines and
swaps the order of the moved lines.

Loading file attachments...

Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/tests.py
        reviewboard/diffviewer/chunk_generator.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/tests.py
        reviewboard/diffviewer/chunk_generator.py
    
    
  2. 
      
David Trowbridge
  1. Ship It!
  2. 
      
Christian Hammond
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (dde9df0)
Loading...