Review Board

beta

Update perforce SCMTool to use p4python 08.1 API.

Submitted
Updated 3 months, 4 weeks ago

David Trowbridge Reviewers
trunk reviewboard
None Review Board SVN
As of the 08.1 API release, the p4python wrapper is now an officially supported
product from Perforce.  This is awesome, but they changed things up a bit
(entirely for the better -- parsing changesets is quite a bit simpler now).
This change updates our perforce tool to use the new API.
This code has been running on reviewboard.eng since they upgraded our main
perforce server a couple months ago.
Posted 3 months, 4 weeks ago (July 23rd, 2008, 1:09 p.m.)

   

  
/trunk/reviewboard/manage.py (Diff revision 1)
87
        imp.find_module('p4')
87
        imp.find_module('$4')
Is this correct? $4?
  1. David Trowbridge 3 months, 4 weeks ago (July 23rd, 2008, 1:16 p.m.)
    Haha, nope.  That's what I get for transcribing the changes onto my laptop.
/trunk/reviewboard/scmtools/perforce.py (Diff revision 1)
58
        return self.parse_change_desc(changeset, changesetid)
59
        return self.parse_change_desc(changeset[0], changesetid)
I ran into a bug with this on our VMware server. If the changeset does not exist, this throws an exception. I suggest:

if changeset:
   return self.parse_change_desc(...)

return None
  1. David Trowbridge 3 months, 4 weeks ago (July 23rd, 2008, 1:17 p.m.)
    Okay.
Ship it!
Posted 3 months, 4 weeks ago (July 23rd, 2008, 1:18 p.m.)
Looks good.