Fix parsing Git diffs with both renaming/copying and changing modes on files.

Review Request #6754 — Created Jan. 9, 2015 and submitted

Information

Review Board
release-2.0.x
efddf5d...

Reviewers

Our Git diff parsing logic assumed that if there was a mode change, the
file was being edited and not renamed/copied. Whether or not that was
once valid, it's not now.

We now separate out the mode checks from the rename/copy checks. As part
of this, we also needed to update those checks to ensure they didn't
check out of the line range, as that resulted in a breakage in a
previous test.

A unit test was added to test for this case.

Unit tests pass.

Tested manually with a previously broken diff. Saw that it contained the expected information.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/tests.py
        reviewboard/scmtools/git.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/tests.py
        reviewboard/scmtools/git.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (e671d15)
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (e671d15)