Fix hg parent diffs (again?).

Review Request #6253 — Created Aug. 21, 2014 and submitted

Information

Review Board
release-2.0.x
20ab8c0...

Reviewers

If a standard hg diff is posted, along with a parent diff, and the diff
touches files that the parent diff didn't, application will fail. This
change now properly fills the source_revision field on these filediffs
so that we don't attempt to fetch the file for the revision the parent
diff created.

The revision handling for the hg case is messy and could really use some
more love to make things more sensical and robust. I'm going to hold off
on any big changes for now since I think it's important to just get this
use case working.

Tested by posting a change with a parent diff that didn't touch files in
the main diff. Applying the diff failed before this patch, and succeeds
after.

Description From Last Updated

Is this used?

daviddavid
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/hg.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/hg.py
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/scmtools/hg.py (Diff revision 1)
     
     
    Show all issues

    Is this used?

    1. Not at all. What this probably should be is info['origChangesetId'] = split_line[2].

      Even so, that won't fix the problem, I don't believe info['origChangesetId'] is ever used anyways.

    2. From diffviewer/parser.py:

      file.origChangesetId = info.get('origChangesetId')
      

      But this is in addition to the line you added.

    3. Sorry, when I said it was never used I meant after being attached to the file object. i.e. it doesn't influence diff display or application.

  3. 
      
SM
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/hg.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/hg.py
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
SM
SM
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (9d3f572)
Loading...