4558: Revision ranges appear not to work with Perforce


What version are you running?


What steps will reproduce the problem?

  1. rbt post some_cl_number some_later_cl

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

I expect a review to be posted with the diffs between those two CLs, for files which are mapped under the client.

What operating system are you using?

Linux, fedora, latest.

Attach the debug out from the command.

λ rbt post --debug 1101286 1103688                                                  
>>> RBTools 0.7.9
>>> Python 2.7.13 (default, May 10 2017, 20:04:28) 
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)]
>>> Running on Linux-4.11.3-202.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five
>>> Home = /home/sjudge
>>> Current directory = /mnt/dev/gauntlet
>>> Command line: rbt post --debug 1101286 1103688
>>> Checking for a Subversion repository...
>>> Unable to execute "svn help": skipping SVN
>>> 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 /mnt/dev)
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...
>>> Unable to execute "cvs": skipping CVS
>>> Checking for a Perforce repository...
>>> Running: p4 info
>>> Running: diff --version
>>> repository info: Path: dvp4edgepl008.tsi.lan:1667, Base path: None, Supports changesets: True
>>> Making HTTP GET request to http://reviewboard/api/
>>> Running: p4 info
Generating diff for range of submitted changes: 1101286 to 1103688
Traceback (most recent call last):
  File "/usr/bin/rbt", line 11, in <module>
  File "/usr/lib64/python2.7/site-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/usr/lib64/python2.7/site-packages/rbtools/commands/__init__.py", line 664, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/usr/lib64/python2.7/site-packages/rbtools/commands/post.py", line 748, in main
  File "/usr/lib64/python2.7/site-packages/rbtools/clients/perforce.py", line 508, in diff
  File "/usr/lib64/python2.7/site-packages/rbtools/clients/perforce.py", line 746, in _compute_range_changes
    change['newFilename'] = file_entry['file1,%d' % cid]
KeyError: u'file1,0'

Please provide any additional information below.

Was able to accomplish what I wanted with this alternative

rbt post //client/root/...@xxx,@yyy

#1 chipx86

In general, we encourage using the native revision range/path specifier for the SCM, which would be the //client/root/...@xxx,@yyy format for Perforce.

That said, we shouldn't crash, and it does claim it's trying to generate a diff of a range of changes, so we should attempt to actually do that.

  • -New
  • +Release-0.7.x
  • +SCM:Perforce
  • +david