3220: rbt post fails

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

0.5.7

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

N/A

What steps will reproduce the problem?
1. git p4 clone --keep-path //depot/somepath
2. vi somefile
3. rbt post -d

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

Expect to post a review, instead see:

DEBUG:root:Running: git diff --no-color --no-prefix -r -u 34f4171655c537708e9f658c76a8374fa7bf5207..523f5bcf6e794bd0969177488b4f2d7722959462
DEBUG:root:Running: git log 34f4171655c537708e9f658c76a8374fa7bf5207
Traceback (most recent call last):
  File "/usr/bin/rbt", line 8, in <module>
    load_entry_point('RBTools==0.5.7', 'console_scripts', 'rbt')()
  File "/usr/lib/python2.6/site-packages/RBTools-0.5.7-py2.6.egg/rbtools/commands/main.py", line 127, in main
    command.run_from_argv([RB_MAIN] + args)
  File "/usr/lib/python2.6/site-packages/RBTools-0.5.7-py2.6.egg/rbtools/commands/__init__.py", line 158, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/usr/lib/python2.6/site-packages/RBTools-0.5.7-py2.6.egg/rbtools/commands/post.py", line 626, in main
    files=args)
  File "/usr/lib/python2.6/site-packages/RBTools-0.5.7-py2.6.egg/rbtools/utils/diffs.py", line 17, in get_diff
    diff_info = scmtool.diff(files)
  File "/usr/lib/python2.6/site-packages/RBTools-0.5.7-py2.6.egg/rbtools/clients/git.py", line 475, in diff
    return self._diff([])
  File "/usr/lib/python2.6/site-packages/RBTools-0.5.7-py2.6.egg/rbtools/clients/git.py", line 450, in _diff
    diff_lines = self.make_diff(revisions['base'], revisions['tip'])
  File "/usr/lib/python2.6/site-packages/RBTools-0.5.7-py2.6.egg/rbtools/clients/git.py", line 502, in make_diff
    return self.make_perforce_diff(ancestor, diff_lines)
  File "/usr/lib/python2.6/site-packages/RBTools-0.5.7-py2.6.egg/rbtools/clients/git.py", line 608, in make_perforce_diff
    ['p4', 'files', base_path + filename + '@' + p4rev],
UnboundLocalError: local variable 'base_path' referenced before assignment
Exit 1

What operating system are you using? What browser?

N/A

Please provide any additional information below.

output of git log looks something like this:

commit b031695712c24e573965525d2391c4fadd08048a
Author: xxx <xxx@foo.com>
Date:   Thu Feb 6 22:39:32 2014 -0800

    binary changes
    [git-p4: depot-paths = "//depot/foo/": change = 1580686: options = keepRepoPath]

Line 586 of git.py contains the following regexp:

m = re.search(r'[rd]epo.-paths = "(.+)": change = (\d+)\]', log,     re.M)

Switching to the following gets past the issue:

m = re.search(r'[rd]epo.-paths = "(.+)": change = (\d+).*\]', log,     re.M)
david
#1 david
  • +EasyFix
    +Component-RBTools
david
#2 david
Fixed in rbtools master (09acaab). Thanks!
  • +Fixed