Fix previously-moved lines impacting future move ranges.

Review Request #9691 — Created Feb. 21, 2018 and submitted

Information

Review Board
release-3.0.x
a3b9a30...

Reviewers

The move detection code keeps a list of indexes that constituted a move,
which is used to filter out ranges from deleted or replaced lines. This
list was only retained while processing a single chunk, which was fine
in the original version of the move detection code when only inserts and
deletes were considered, but not when taking into account replaced
lines.

This manifested as a problem when working with a moved range of lines
where one or more of the lines were equal to a line previously
considered in a range for a different chunk. Since the previous line
was no longer flagged as being included in a move, it was considered
a valid range for a move, and was then later discarded. This broke up
the actual valid range, causing a gap.

The list is now retained for the entire move detection process, ensuring
that we safely ignore any lines already part of a move.

Unit tests pass.

Tested with a diff exhibiting a gap in a move detection range. The gap
went away.

david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (5860fb8)
Loading...