Status: New
Owner:
Labels: Type-Defect Priority-Medium
New issue 3749 by griffin@gmail.com: rbt diff/post for Subversion is
badly broken in 0.7.0 due to changes making diffs relative to the checkout
root
https://code.google.com/p/reviewboard/issues/detail?id=3749
What version are you running?
RBTools 0.7.0
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?
Seeing multiple types of crashes.
What operating system are you using? What browser?
CentOS 7, Python 2.7.5
Please provide any additional information below.
I believe the changes in 31aabc4 have introduced some serious regressions
for SVN. For reference from the commit message:
SVN and CVS no longer create diffs relative to current working directory.
CVS and SVN now change to the root directory of the repository for
performing diffs (before changing back).
Furthermore, when discussing this change in the RBTools 0.7.0 release
notes, it is noted that:
The old behavior can be used with the command rbt post -I .
I cannot comment on what implications these changes may have for CVS, but
for SVN I've observed at least two different types of crashes, both of
which can be traced to attempting to perform an rbt diff/post operation
from *anywhere* other than the root of the working copy.
**Directory Structure**
Assume an svn working copy at /home/gmyers/wc, with a single file (b.txt)
with local modifications.
[gmyers@centos7-vm wc]$ tree /home/gmyers/wc
/home/gmyers/wc
├── branches
├── tags
└── trunk
├── a.txt
└── dir1
└── b.txt
[gmyers@centos7-vm wc]$ svn status
M trunk/dir1/b.txt
**Crash #1**
Execute 'rbt diff' from the trunk directory. Conceptually this should
generate a diff from the working copy root (/home/gmyers/wc) and b.txt
should be the only file present in the diff. Crash below occurs because
svn info is being executed on '/home/gmyers/wc/trunk/trunk/dir1/b.txt'
(Note: trunk is duplicated in the path). Following the changes in 31aabc4,
we start in the /home/gmyers/wc/trunk directory but immediately change to
the working copy root in /home/gmyers/wc. We generate the diff here which
causes the diff to be relative to wc/ and thus the filestring within the
diff looks like 'trunk/dir1/b.txt'. Next we change back to
/home/gmyers/wc/trunk and then we attempt to operate on the filestring from
within the diff relative to this cwd. Since we are in the trunk directory
and already have trunk/ in the filestring in the diff, we get duplicate
trunk/ fields when assembling the full path.
[gmyers@centos7-vm trunk]$ rbt diff -d
RBTools 0.7
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)]
Running on
Linux-3.10.0-123.13.2.el7.x86_64-x86_64-with-centos-7.0.1406-Core
Home = /home/gmyers
Current directory = /home/gmyers/wc/trunk
Checking for a Subversion repository...
Running: svn info --non-interactive
Running: diff --version
repository info: Path: file:///home/gmyers/svn_repo/myrepo, Base path:
/trunk, Supports changesets: False
Making HTTP GET request to http://localhost:8080/api/
Cached response for HTTP GET http://localhost:8080/api/ expired and was
modified
Running: svn info --non-interactive
Running: diff --version
repository info: Path: file:///home/gmyers/svn_repo/myrepo, Base path:
/trunk, Supports changesets: False
Running: svn status --ignore-externals
Running: svn info .
Running: svn diff --diff-cmd=diff --notice-ancestry -r BASE
Running: svn info trunk/dir1/b.txt
Command exited with rc 1: ['svn', 'info', u'trunk/dir1/b.txt']
[svn: warning: W155010: The node '/home/gmyers/wc/trunk/trunk/dir1/b.txt'
was not found.\n, '\n', svn: E29: Could not display info for all
targets because some targets don't exist\n]---
Traceback (most recent call last):
File /home/gmyers/envs/rbt_0.7.0/bin/rbt, line 9, in module
load_entry_point('RBTools==0.7', 'console_scripts', 'rbt')()
File /home/gmyers/envs/rbt_0.7.0/lib/python2.7/site-packages/RBTools-0.7-py2.7.egg/rbtools/commands/main.py,
line 133, in main
command.run_from_argv([RB_MAIN, command_name] + args)
File /home/gmyers/envs/rbt_0.7.0/lib/python2.7/site-packages/RBTools-0.7-py2.7.egg/rbtools/commands/__init__.py,
line 538, in run_from_argv
exit_code = self.main(*args) or 0
File /home/gmyers/envs/rbt_0.7.0/lib/python2.7/site-packages/RBTools-0.7-py2.7.egg/rbtools/commands/diff.py,
line 68, in main
extra_args=extra_args)
File /home/gmyers/envs/rbt_0.7.0/lib/python2.7/site-packages/RBTools-0.7-py2.7.egg/rbtools/clients/svn.py,
line 305, in diff
diff = self.handle_renames(diff)
File /home/gmyers/envs/rbt_0.7.0/lib/python2.7/site-packages/RBTools-0.7-py2.7.egg/rbtools/clients/svn.py,
line 424, in handle_renames
copied_from = self.find_copyfrom(to_file)
File