3250: rbtools master can't diff subversion repos

bba***@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 15, 2014
What version are you running?

RBTools 0.6.0 alpha (56b10914da751c355a5becbf60615123f5090e7a)


What's the URL of the page containing the problem?

N/A - rbtools

What steps will reproduce the problem?
1. Run 'rbt diff' from a subversion repository
2.
3.

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

Expected to see the diff. Got:

$ rbt diff --debug
DEBUG:root:Checking for a Subversion repository...
DEBUG:root:Running: svn info --non-interactive
DEBUG:root:Running: diff --version
DEBUG:root:repository info: Path: http://XXXXX, Base path: /YYYYY, Supports changesets: False
DEBUG:root:Making HTTP GET request to https://reviewboard.optusnet.com.au/api/
DEBUG:root:Making HTTP GET request to https://reviewboard.optusnet.com.au/api/info/
DEBUG:root:Running: svn log -r BASE -l 1 --xml
Traceback (most recent call last):
  File "/usr/bin/rbt", line 9, in <module>
    load_entry_point('RBTools==0.6alpha0.dev', 'console_scripts', 'rbt')()
  File "/usr/lib/python2.7/site-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/main.py", line 127, in main
    command.run_from_argv([RB_MAIN] + args)
  File "/usr/lib/python2.7/site-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/__init__.py", line 158, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/usr/lib/python2.7/site-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/diff.py", line 134, in main
    files=self.options.include_files)
  File "/usr/lib/python2.7/site-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/utils/diffs.py", line 11, in get_diff
    return scmtool.diff(revision_spec, files)
  File "/usr/lib/python2.7/site-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/clients/svn.py", line 207, in diff
    revisions = self.parse_revision_spec(revision_spec)
  File "/usr/lib/python2.7/site-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/clients/svn.py", line 111, in parse_revision_spec
    'base': self._convert_symbolic_revision('BASE'),
  File "/usr/lib/python2.7/site-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/clients/svn.py", line 167, in _convert_symbolic_revision
    raise ValueError
ValueError


What operating system are you using? What browser?

linux, fedora 20

Please provide any additional information below.

parse_revision_spec calls _convert_symbolic_revision('BASE'). but:

$ svn log -r BASE  --xml
<?xml version="1.0" encoding="UTF-8"?>
<log>
</log>

"svn diff -r BASE" works, and replacing "_convert_symbolic_revision('BASE')" with 'BASE' works too, at least in a simple test.

What is _convert_symbolic_revision meant to be doing? What sort of revisions can it take?

This was fine in 0.5 (I'm running 0.6 because I have a patch to submit for something else, and ran into this)

Using subversion-1.8.5-2.fc20.x86_64
#1 bba***@gmai***** (Google Code) (Is this you? Claim this profile.)
This is caused when the checked out subdirectory doesn't contain the full repo (eg if /trunk is checked out), and there are other changes (eg on a branch).

In that case, BASE is the revision on the branch, but there's no log for that revision because the module doesn't know about it.

Standalone shell script to reproduce this is attached
  • +
    #!/bin/sh
    # Create the module
    svnadmin create /tmp/repotest
    # Check it out
    svn co file:///tmp/repotest working
    # set up structure
    cd working
    svn mkdir trunk
    svn mkdir branches
    svn ci -m "Structure"
    # Create a file
    cd trunk
    echo "TEST" > testfile
    svn add testfile
    svn ci -m 'test file'
    cd ..
    # Branch
    svn copy trunk branches/branch1
    svn ci -m 'create branch'
    # Change on branch
    cd branches/branch1
    echo "CHANGED" > testfile
    svn ci -m "Branch change"
    cd ../..
    # Check out just trunk
    svn co file:///tmp/repotest/trunk working-trunk
    cd working-trunk
    # And repoduce the bug
    echo "TRUNK CHANGE" > testfile
    echo
    echo "rbt diff"
    rbt diff
    echo
    echo "svn info"
    svn info
    echo
    echo "svn log"
    svn log -r BASE --xml
david
#2 david
Fixed in rbtools master (ef06181). Thanks!
  • +Fixed