3649: rbt post with Subversion does not respect included files in conjuction with --svn-show-copies-as-adds

gmyers
Feb. 25, 2015
What version are you running?
RBTools 0.6.2
svn 1.8.10

What's the URL of the page containing the problem?
n/a

What steps will reproduce the problem?
1. See below

What is the expected output? What do you see instead?
See below

What operating system are you using? What browser?
Windows 7

Please provide any additional information below.

I think there is a bug in diff() in svn.py.  In diff() at approximately line 283 history_scheduled_with_commit() is called with a changelist parameter to check for a '+' in the 4th column of the output from svn status.  The svn status command is performed over the changelist if one is provided.  If a '+' is detected then the --svn-show-copies-as-adds command line parameter must be preset, if it is not present then processing terminates and the user is warned.

The problem is that changelist does not represent any files that may be explicitly included with the -I command line parameter.  Typically, for the case where no changelist is provided, history_scheduled_with_commit() will check the svn status on the current directory only.  The status here may not be representative of the true status of other files/folders included with -I.  Thus, if the current directory has no '+' status, but an included directory does, the added/copied files with '+' will not be part of the diff.  Furthermore, in this case even if --svn-show-copies-as-adds is provided as a command line parameter it does no good because this parameter doesn't get internally applied except when a '+' status is detected in the current directory.

Below is an example with rbt diff for clarity.  Here fileA.txt had modifications and subfolder\fileB.txt has been copied in from elsewhere.  Executing from dirA, we see that the results from svn status are as expected.  Running rbt diff here displays the expected warning (incidentally, adding --svn-show-copies-as-adds=y to the command line will correctly display a diff with fileA.txt changes and the whole of fileB.txt).  Running rbt with an explicit include of the local directory has the same behavior.  Now, if we move up one folder and then try "rbt diff -I dirA" we get no warning message and only get a diff containing the changes in fileA.txt.

C:\dirA>svn status
M       fileA.txt
A  +    subfolder\fileB.txt

C:\dirA>rbt diff
One or more files in your changeset has history scheduled with commit. Please try again with '--svn-
show-copies-as-adds=y/n'

C:\dirA>rbt diff -I .
One or more files in your changeset has history scheduled with commit. Please try again with '--svn-
show-copies-as-adds=y/n'

C:\dirA>cd ..

C:\>rbt diff -I dirA
<diff is displayed showing fileA.txt changes, but does not include subfolder\fileB.txt>
david
#1 david
Fixed in release-0.7.x (e20a1ba). Thanks!
  • +Fixed