Handle parse errors during diff migration.

Review Request #5485 — Created Feb. 16, 2014 and submitted

Information

Review Board
master
77d8407...

Reviewers

Handle parse errors during diff migration.

The new diff size column would cause migrations for old diff data. In the case
where a very old review request has un-migrated data which doesn't parse
correctly (from back when you could attach a bogus diff to a review request),
it would cause an un-caught exception. This change handles DiffParseErrors in
the recalculate_line_counts method.

Ran unit tests.

Description From Last Updated

Are line numbers 1-based or 0-based for this error? (Wish we had that in a docstring for the class.) I …

chipx86chipx86

Comma instead of %? Do we want to use exc_info=1? Might not be useful enough to us, but shrug.

chipx86chipx86

This will cause format string problems. Shouldn't have the parens.

chipx86chipx86
chipx86
  1. 
      
  2. reviewboard/diffviewer/models.py (Diff revision 1)
     
     
    Show all issues

    Are line numbers 1-based or 0-based for this error?

    (Wish we had that in a docstring for the class.)

    I also had to look up what the 1 was for. Can you use a keyword argument?

    1. I don't know, but the linenum isn't used here at all. I'll just make it an optional parameter.

  3. reviewboard/diffviewer/models.py (Diff revision 1)
     
     
     
    Show all issues

    Comma instead of %?

    Do we want to use exc_info=1? Might not be useful enough to us, but shrug.

  4. 
      
david
chipx86
  1. 
      
  2. reviewboard/diffviewer/models.py (Diff revisions 1 - 2)
     
     
    Show all issues

    This will cause format string problems. Shouldn't have the parens.

  3. 
      
david
chipx86
  1. Ship It!

  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (3d12bee).
Loading...