3248: rbt: svn client incorrectly detects "history scheduled with commit", always requires --svn-show-copies-as-adds=y/n
- Fixed
- Review Board
vladr | |
Feb. 15, 2014 |
What version are you running? 0.5.6 What's the URL of the page containing the problem? n/a What steps will reproduce the problem? 1. add a new file X to branch BrA, commit 2. svn merge X from branch BrA to branch BrB in working copy (status "A +") 3. modify file Y in working copy, send ONLY file Y (status "M) to changelist CL 4. rbt post --svn-changelist=CL What is the expected output? What do you see instead? Expected: post succeeds, because changelist only contains modified files Actual: post fails with "Please try again with '--svn-show-copies-as-adds=y/n'"; this is because rbt "sees" file X, despite explicitly only posting Y for review. What operating system are you using? What browser? Windows/cygwin; n/a Please provide any additional information below. Should modify history_scheduled_with_commit in rbtools/clients/svn.py to pass --changelist option down to 'svn st' if --svn-changelist was given to rbt
Patch: --- a/rbtools/clients/svn.py 2014-02-03 16:23:05.381608100 -0500 +++ b/rbtools/clients/svn.py 2014-02-12 15:07:36.649756000 -0500 @@ -281,7 +281,7 @@ svn_show_copies_as_adds = getattr( self.options, 'svn_show_copies_as_adds', None) - if self.history_scheduled_with_commit(): + if self.history_scheduled_with_commit(cmd): if svn_show_copies_as_adds is None: sys.stderr.write("One or more files in your changeset has " "history scheduled with commit. Please try " @@ -298,10 +298,18 @@ return ''.join(diff) - def history_scheduled_with_commit(self): + def history_scheduled_with_commit(self, cmd): """ Method to find if any file status has '+' in 4th column""" - for p in execute(["svn", "st"], split_lines=True): + svn_st_params = ["svn", "st"] + try: + changelist_pos = cmd.index('--changelist') + svn_st_params.append('--cl') + svn_st_params.append(cmd[changelist_pos + 1]) + except: + pass + + for p in execute(svn_st_params, split_lines=True): if p.startswith('A +'): return True return False