Fix interdiffs when comparing revisions with stripped-slash filenames.

Review Request #6272 — Created Aug. 26, 2014 and submitted

Information

Review Board
release-2.0.x
c38688b...

Reviewers

The leading-slash stripping code strikes again. In this case, an initial
revision of a diff was uploaded prior to an upgrade, and a new version was
uploaded subsequent. The result is that the filenames don't match exactly
because one has leading slashes and the other doesn't.

This change normalizes the filenames to always compare them without leading
slashes when figuring out which files match up with which.

Created two diff revisions and changed the FileDiffs in the database so that
the first one had leading slashes and the second didn't. Before this change, I
see two entries in the interdiff for that file. After, it shows the correct
interdiff.

Tested all permutations of leading slash/no leading slash in interdiff
combinations.

Description From Last Updated

The other normalization code only removes the first slash. We should be consistent. Actually, can we just grab the diff …

chipx86chipx86

Col: 5 E301 expected 1 blank line, found 0

reviewbotreviewbot
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/diffutils.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/diffutils.py
    
    
  2. 
      
chipx86
  1. 
      
  2. reviewboard/diffviewer/diffutils.py (Diff revision 1)
     
     
    Show all issues

    The other normalization code only removes the first slash. We should be consistent.

    Actually, can we just grab the diff parser from the repository's tool and call normalize_diff_filenames() on it, instead of re-implementing this logic?

  3. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/diffutils.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/diffutils.py
    
    
  2. reviewboard/diffviewer/diffutils.py (Diff revision 2)
     
     
    Show all issues
    Col: 5
     E301 expected 1 blank line, found 0
    
  3. 
      
chipx86
  1. After Review Bot's complaint is fixed, I'm happy!

  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (1f6abba)