[Buildbot-commits] [Buildbot] #2069: Information on improving P4 object

Buildbot nobody at buildbot.net
Wed Aug 3 01:51:58 UTC 2011

#2069: Information on improving P4 object
Reporter:  johnwbyrd    |      Owner:
    Type:  enhancement  |     Status:  new
Priority:  trivial      |  Milestone:  undecided
 Version:  0.8.4p2      |   Keywords:  perforce changes p4
 I don't think that this is a "bug" per se -- it's more of information on
 how I worked around a behavior.

 When using Perforce, it is often useful to be able to specify the current
 branch to the build environment on the target.  There are commands like
 "p4 changes" that report changes on an existing branch.

 At least on my Buildbot, I haven't been able to figure out a way to do
 that with the existing P4 architecture.  The following object works around
 this behavior, and provides a new object that records the current working
 branch as a property p4branch.

 class P4RememberBranch(P4):
         """ P4RememberBranch is a class for accessing perforce revision
 control and recording the working branch.  """
         name = "P4RememberBranch"

         def __init__(self, **kwargs):
                 P4.__init__(self, **kwargs)
                 self.p4branch = self.p4base + self.branch + r'/'

         def startVC(self, branch, revision, patch):
                 self.build.setProperty('p4branch', self.p4branch,
                 P4.startVC( self, branch, revision, patch )

Ticket URL: <http://trac.buildbot.net/ticket/2069>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation

More information about the Commits mailing list