What version are you running?
RBTools 0.7.5
Review Board 2.0.18
Perforce 2015.2p3What steps will reproduce the problem?
- submit several changes to Perforce under //depot/path/to/dir/...
- rbt post //depot/path/to/dir/...@1570748,@1570964
What is the expected output? What do you see instead?
Expected: the review to be posted
Actual: rbt fails with this error message:
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.7.5-py2.7.egg/rbtools/clients/perforce.py", line 666, in get_changenum
tip = revisions['tip']
TypeError: 'NoneType' object has no attribute 'getitem'What operating system are you using?
Debian Linux 7.4
Attach the debug out from the command.
rbt post --debug //depot/path/to/dir/...@1570748,@1570964
RBTools 0.7.5
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2]
Running on Linux-3.10-0.bpo.tmw5-amd64-x86_64-with-debian-7.4
Home = /home/jloverso
Current directory = /local-ssd/tmp/Bmw
Checking for a Subversion repository...
Running: svn --non-interactive info
Command exited with rc 1: ['svn', '--non-interactive', u'info']
svn: '.' is not a working copy
Checking for a Git repository...
Running: git rev-parse --git-dir
Command exited with rc 128: ['git', 'rev-parse', '--git-dir']
fatal: Not a git repository (or any parent up to mount point /local-ssd)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Checking for a Mercurial repository...
Unable to execute "hg --help": skipping Mercurial
Checking for a CVS repository...
Checking for a Perforce repository...
Running: p4 info
Running: diff --version
repository info: Path: p4test.mathworks.com:1666, Base path: None, Supports changesets: True
Making HTTP GET request to http://reviewboard.mathworks.com/api/
Running: p4 info
Writing "//depot/path/to/dir/workflows_controller.rb#35" to "/tmp/tmpjNBNUR"
Running: p4 print -o /tmp/tmpjNBNUR -q //depot/path/to/dir/workflows_controller.rb#35
Writing "//depot/path/to/dir/workflows_controller.rb#37" to "/tmp/tmpFF_1Pi"
Running: p4 print -o /tmp/tmpFF_1Pi -q //depot/path/to/dir/workflows_controller.rb#37
Running: diff -urNp /tmp/tmpjNBNUR /tmp/tmpFF_1Pi
Command exited with rc 1: [u'diff', u'-urNp', '/tmp/tmpjNBNUR', '/tmp/tmpFF_1Pi']
Writing "//depot/path/to/dir/routes.rb#82" to "/tmp/tmpjNBNUR"
Running: p4 print -o /tmp/tmpjNBNUR -q //depot/path/to/dir/routes.rb#82
Writing "//depot/path/to/dir/routes.rb#83" to "/tmp/tmpFF_1Pi"
Running: p4 print -o /tmp/tmpFF_1Pi -q //depot/path/to/dir/routes.rb#83
Running: diff -urNp /tmp/tmpjNBNUR /tmp/tmpFF_1Pi
Command exited with rc 1: [u'diff', u'-urNp', '/tmp/tmpjNBNUR', '/tmp/tmpFF_1Pi']
Making HTTP GET request to http://reviewboard.mathworks.com/api/validation/diffs/
Cached response for HTTP GET http://reviewboard.mathworks.com/api/validation/diffs/ expired and was modified
Making HTTP POST request to http://reviewboard.mathworks.com/api/validation/diffs/
Traceback (most recent call last):
File "/usr/local/bin/rbt", line 9, in <module>
load_entry_point('RBTools==0.7.5', 'console_scripts', 'rbt')()
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.7.5-py2.7.egg/rbtools/commands/main.py", line 133, in main
command.run_from_argv([RB_MAIN, command_name] + args)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.7.5-py2.7.egg/rbtools/commands/init.py", line 622, in run_from_argv
exit_code = self.main(*args) or 0
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.7.5-py2.7.egg/rbtools/commands/post.py", line 765, in main
changenum = self.tool.get_changenum(self.revisions)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.7.5-py2.7.egg/rbtools/clients/perforce.py", line 664, in get_changenum
tip = revisions['tip']
TypeError: 'NoneType' object has no attribute 'getitem'Please provide any additional information below.
The problem is that the code in post.py is attempting to find the change number to use as a commit_id, but when given a Perforce depot path and a set of revisions, there isn't a change number.
I fixed this by updating get_changenum in perforce.py to return None when "revisions" isn't populated (since it already had a code path that returned None).
--- /usr/local/lib/python2.7/dist-packages/RBTools-0.7.5-py2.7.egg/rbtools/clients/perforce.py 2016-01-12 11:22:40.788716724 -0500
+++ /tmp/perforce.py 2016-01-12 11:23:13.241199391 -0500
@@ -660,6 +660,8 @@
# this to remove the server-side implementation and just implement
# --guess-summary and --guess-description, but that would likely
# create a lot of unhappy users.
+ if revisions is None or 'tip' not in revisions:
+ return Nonetip = revisions['tip']
I believe it's a duplicate of https://hellosplat.com/s/beanbag/tickets/4003/ . Even proposed solution is the same!
It's sad that RB team ignores this bug for so long.
The "RB team" is very small and very busy.
We're quite clear both in the documentation and when filing tickets on this bug tracker that patches need to be put up on https://reviews.reviewboard.org. If you want to get this fix in soon, please put it there.