Fix mangling of SVN diffs that contain lines that look like headers.

Review Request #8934 — Created May 9, 2017 and submitted — Latest diff uploaded

Information

RBTools
release-0.7.x
bc5f118...

Reviewers

If a file has a removed line that looks vaguely like a file header (i.e. the
line is "-- XX (Y)"), the entry for the removed line in the diff would get
filtered out by our code that tries to mangle the diffs to make renames and
copies work properly.

This change makes the code that detects and mangles file headers much more
specific, looking at each chunk of 5 lines instead of lines one by one.

  • Created a reproduction case and verified that rbt diff and svn diff
    produced the same output.
  • Wrote a unit test and checked that the test failed before the change and
    succeeded afterward.
  • Ran entire test suite.