3347: rbt post fails for submitted perforce changelist

csetri*******@gmai***** (Google Code) (Is this you? Claim this profile.)
david
david
May 19, 2014
What version are you running?
RBTools 0.6
Python 2.7.5

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

What steps will reproduce the problem?
1.rbt post <perforce-changenum>

What is the expected output? What do you see instead?
expected: review created with the files and diffs found in the perforce changelist
instead: error:
Failed to execute command: ['p4', '-G', 'where', '//path/to/file/in/changenum-1/changelist']
or
Failed to execute command: ['p4', '-G', 'where', '//path/to/file/in/changenum/changelist']

What operating system are you using? What browser?
Windows 7

Please provide any additional information below.

There are two main problems as I see:

First, "rbt post <perforce-changenum>" calls "p4 where //path/to/file" which returns "file(s) not in client view" if current directory of shooting "rbt post" command is not under the root of the perforce workspace mapping the concerned files. This may be worked around by changing directory but only if I have a workspace which maps the files affected in the changelist.


Second "rbt post <perforce-changenum>" calls "p4 filelog //...@<changenum-1>,<changenum>" which includes changes not only from <changenum> changelist but also from <changenum-1> changelist (based to <changenum-2>) which is undesirable here. (As the description of parse_revision_spec in PerforceClient class in perforce.py is wrongly mentioning "changes in (base, tip]", it is correctly [base,tip]). Later _depot_to_local fails because changenum-1 is usually a change from totally elsewhere in the depot causing problems mentioned above.

For the second I see the solution:
clients/perforce.py - class PerforceClient - def parse_revision_spec - n_revs == 1 ... - status == 'submitted' ...:
'base': str(cln-1)
should be 
'base': str(cln)


Debug output:

rbt post -d 560826

>>> RBTools 0.6
>>> Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]
>>> Running on Windows-7-6.1.7601-SP1
>>> Home = C:\Users\acsetri\AppData\Roaming
>>> Current directory = e:\Dev\B315-Rhino
>>> Checking for a Subversion repository...
>>> Unable to execute "svn help": skipping SVN
>>> Checking for a Git repository...
>>> Unable to execute "git --help" or "git.cmd --help": skipping Git
>>> 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: ['Perforce.graphisoft.hu:1666', 'perforce.graphisoft.hu:1666'], Base path: None, Supports changesets: True
>>> Making HTTP GET request to http://reviewboard.graphisoft.hu/api/
>>> Making HTTP GET request to http://reviewboard.graphisoft.hu/api/info/
Generating diff for range of submitted changes: 560825 to 560826
//Development/Corbusier/LIB-18/Sources/ArchiCADLibrary/INT/Object Library/1. BASIC LIBRARY/1.1 Furnishing/Appliances/Built-in Ovens.xml - file(s) not in client view.

Failed to execute command: ['p4', '-G', 'where', '//Development/Corbusier/LIB-18/Sources/ArchiCADLibrary/INT/Object Library/1. BASIC LIBRARY/1.1 Furnishing/Appliances/Built-in Ovens.xml']

Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\visualstudio_py_util.py", line 76, in exec_file
    exec(code_obj, global_variables)
  File "C:\Python27\Lib\site-packages\RBTools-0.6-py2.7.egg\rbtools\commands\main.py", line 151, in <module>
    main()
  File "C:\Python27\Lib\site-packages\RBTools-0.6-py2.7.egg\rbtools\commands\main.py", line 134, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "C:\Python27\lib\site-packages\rbtools-0.6-py2.7.egg\rbtools\commands\__init__.py", line 422, in run_from_argv
    exit_code = self.main(*args) or 0
  File "C:\Python27\lib\site-packages\rbtools-0.6-py2.7.egg\rbtools\commands\post.py", line 729, in main
    extra_args=extra_args)
  File "C:\Python27\lib\site-packages\rbtools-0.6-py2.7.egg\rbtools\clients\perforce.py", line 461, in diff
    base, tip, depot_include_files, local_include_files)
  File "C:\Python27\lib\site-packages\rbtools-0.6-py2.7.egg\rbtools\clients\perforce.py", line 713, in _compute_range_changes
    local_file = self._depot_to_local(depot_file)
  File "C:\Python27\lib\site-packages\rbtools-0.6-py2.7.egg\rbtools\clients\perforce.py", line 1213, in _depot_to_local
    where_output = self.p4.where(depot_path)
  File "C:\Python27\lib\site-packages\rbtools-0.6-py2.7.egg\rbtools\clients\perforce.py", line 92, in where
    return self.run_p4(['where', depot_path], marshalled=True)
  File "C:\Python27\lib\site-packages\rbtools-0.6-py2.7.egg\rbtools\clients\perforce.py", line 136, in run_p4
    die('Failed to execute command: %s\n' % (cmd,))
  File "C:\Python27\lib\site-packages\rbtools-0.6-py2.7.egg\rbtools\utils\process.py", line 19, in die
    sys.exit(1)
SystemExit: 1
Press any key to continue . . .
david
#1 david
The first part of your request is covered by bug 3318.

I'll put up a change to fix the second part.
  • +PendingReview
  • +Component-RBTools
  • +david
david
#2 david
Fixed in release-0.6.x (b64f6a4). Thanks!
  • -PendingReview
    +Fixed