Allow "rbt patch --print" to be run outside of a build tree.

Review Request #8592 — Created Jan. 4, 2017 and submitted

Information

RBTools

Reviewers

If one runs "rbt patch --server <server-URL> --print <rid>" outside of a build tree, the following error message is displayed:
CRITICAL:root:Values instance has no attribute 'repository_url'

This is caused by the patch command always initializing the SCM tool and needing to check for respository info on the Review Board server matching the local ones.

When using the --print option (outputting to stdout) to the patch command, there is no need to verify the repository info. Therefore, this change avoids both initializing the SCM tool and doing the respository info check when the patch_stdout is set in the patch command options.

Tested by using --print option to patch command to fetch various diffs from review requests in local Review Board instance, both inside and outside of build trees. The diff was displayed in both combination, if a diff existed in a review with the specified review ID.

Also used the patch command without the --print option to apply patches to build trees for projects checked out from Subversion or cloned from Git repositories that also had reviews in the local Review Board instance.

Lastly, used the patch command without the --print option outside of a build tree in order to ensure proper error messages are displayed. The following error message was displayed:
ERROR: The current directory does not contain a checkout from a supported source code repository.

Description From Last Updated

Re-add this.

brenniebrennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/commands/patch.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/commands/patch.py
    
    
  2. 
      
brennie
  1. 
      
  2. rbtools/commands/patch.py (Diff revision 1)
     
     
    Show all issues

    Re-add this.

  3. 
      
HA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/commands/patch.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/commands/patch.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
HA
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.7.x (3d73efd)
Loading...