Enhance Review Board RBTools (rbt) to support svn tree (or file) copy

Review Request #4279 — Created July 2, 2013 and submitted

sudhirbs
RBTools
master
3024
rbtools
chipx86
RBTools (rbt post) does NOT support svn tree copy (or file/files copy) from other branches. With this change, rbt notifies user that it has detected tree/file copy and asks the user if the review should contain files added as part of svn copy or not.
sudhirbs@rhel-sudhirbs $ svn cp $svn/branch/dir .
A    dir/a.c
A    dir/b.c
Checked out revision XXXXX.
A         dir



sudhirbs@rhel-sudhirbs usbrdl $ svn st
A  +    dir 


1. Test using NO svn changelist
sudhirbs@rhel-sudhirbs $ rbt post
One or more files in your changeset has history scheduled with commit.
Please add option '--svn-show-copies-as-adds=y/n' and re-run

sudhirbs@rhel-sudhirbs $ rbt post --svn-show-copies-as-adds=y
Review request #ddddd posted.


2. Test using svn changelist
sudhirbs@rhel-sudhirbs $ rbt post --svn-changelist=tree_copy_1_file

One or more files in your changeset has history scheduled with commit.
Please add option '--svn-show-copies-as-adds=y/n' and re-run



sudhirbs@rhel-sudhirbs $ rbt post  --svn-changelist=tree_copy_1_file --svn-show-copies-as-adds=y
Review request #ddddd posted.

Description From Last Updated

Instead of plumbing this parameter through and having special casing things based on the scmtool name, this should fetch it ...

daviddavid

Col: 40 E711 comparison to None should be 'if cond is None:'

reviewbotreviewbot
david
  1. I'm struggling a little bit to understand the use case for this. What's the current behavior in this case?
    1. Hi David, User/Reviewer may be interested to find all the files in the review. 
      Otherwise, 'rbt post' doesn't show the 'svn cp' files. In fact if the user has only svn copied files in workspace, 'rbt post' reports no diffs found in workspace.
    2. I'm wondering if we can't just always use show-copies-as-adds and avoid asking the user for input.
    3. User may or may not want to post these copied files for review since these are existing files. (If copied tree is large, then user likely prefers not to post for review since it is not newly developed code).
  2. 
      
david
  1. 
      
  2. rbtools/clients/svn.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Instead of plumbing this parameter through and having special casing things based on the scmtool name, this should fetch it from the options object:
    
    svn_show_copies_as_adds = getattr(
        self.options, 'svn_show_copies_as_adds', None)
    
    This should simplify the change quite a bit.
  3. 
      
SU
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/commands/post.py
        rbtools/clients/svn.py
        rbtools/commands/diff.py
      Ignored Files:
    
    
  2. rbtools/clients/svn.py (Diff revision 2)
     
     
    Col: 40
     E711 comparison to None should be 'if cond is None:'
    
  3. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        rbtools/commands/post.py
        rbtools/clients/svn.py
        rbtools/commands/diff.py
      Ignored Files:
    
    
  2. 
      
SU
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/commands/post.py
        rbtools/clients/svn.py
        rbtools/commands/diff.py
      Ignored Files:
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        rbtools/commands/post.py
        rbtools/clients/svn.py
        rbtools/commands/diff.py
      Ignored Files:
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
SU
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to rbtools master (78715e4). Thanks!
Loading...