• 
      

    Fix an UnboundLocalError when using --diff-filename.

    Review Request #7482 — Created July 3, 2015 and submitted

    Information

    RBTools
    release-0.6.x
    9d95189...

    Reviewers

    The calculation of the changenum/commit ID was trying to reference a variable
    that wasn't set using --diff-filename. This change fixes it.

    Posted this change using --diff-filename.

    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          rbtools/commands/post.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          rbtools/commands/post.py
      
      
    2. 
        
    brennie
    1. Ship It!
    2. 
        
    gmyers
    1. 
        
    2. rbtools/commands/post.py (Diff revision 1)
       
       
       
       

      I have a naive question (mostly because I'm not familiar with SCMs where supports_changesets is true). I agree that this fix resolves the crash from the bug report, but isn't there a secondary component whereby changenum really does need need to be set to a legit value (the parameter from the command line) for the subsequent call to post_request()?

      1. I don't think we've ever properly supported --diff-filename on SCMs that use changenums. We probably should, but that should be a separate change.

      2. My read on the bug report, is that this is really the issue the author was getting at.  He claims this worked in 0.5.2 and skimming the code at line 636 (https://github.com/reviewboard/rbtools/blob/release-0.5.x/rbtools/commands/post.py#L636) I might agree with him, although I do not have a way to test and verify this.
    3. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-0.6.x (8ec9937)