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: E200009: 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 "/home/gmyers/envs/rbt_0.7.0/lib/python2.7/site-packages/RBTools-0.7-py2.7.egg/rbtools/clients/svn.py", line 361, in find_copyfrom
    info = self.svn_info(path1, ignore_errors=True) or {}
File "/home/gmyers/envs/rbt_0.7.0/lib/python2.7/site-packages/RBTools-0.7-py2.7.egg/rbtools/clients/svn.py", line 575, in svn_info
    none_on_ignored_error=True)
File "/home/gmyers/envs/rbt_0.7.0/lib/python2.7/site-packages/RBTools-0.7-py2.7.egg/rbtools/clients/svn.py", line 665, in _run_svn
    return execute(cmdline, *args, **kwargs)
File "/home/gmyers/envs/rbt_0.7.0/lib/python2.7/site-packages/RBTools-0.7-py2.7.egg/rbtools/utils/process.py", line 95, in execute
    if split_lines and len(data) > 0:
TypeError: object of type 'NoneType' has no len()


**Crash #2**
Execute 'rbt diff -I .' from the trunk directory. The behavior is identical to Crash #1, but per the Release Notes including '-I .' is supposed to execute the old behavior. As far as I can tell, including '-I .' has no effect whatsoever. I will not include a dump here because it is essentially identical to #1.


**Crash #3**
Execute 'rbt diff -I dir1/b.txt' from the trunk directory. Conceptually this should generate a diff explicitly for file dir1/b.txt. Crash below occurs because 'svn diff' is being execute from the working copy root (/home/gmyers/wc), but the specified include file is relative to trunk (/home/gmyers/wc/trunk). Thus when svn looks for '/home/gmyers/wc/dir1/b.txt' and rightfully can't find it. Based on this, I believe the functionality of rbt diff/post to include files (-I or --include) is completely broken unless rbt is executed from the root of a working copy.


[gmyers@centos7-vm trunk]$ rbt diff -d -I dir1/b.txt
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 dir1/b.txt
Failed to execute command: ['svn', 'diff', '--diff-cmd=diff', '--notice-ancestry', '-r', 'BASE', 'dir1/b.txt'] ["svn: E150000: '/home/gmyers/wc/dir1/b.txt' is not under version control\n"]



All three of these cases work fine in RBTools 0.6.3 and also appear to work fine in 0.7.0 if 31aabc4 is reverted.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.

Reply via email to