Next: , Previous: PBChangeSource, Up: Change Sources


4.6.6 P4Source

The P4Source periodically polls a Perforce depot for changes. It accepts the following arguments:

p4base
The base depot path to watch, without the trailing '/...'.
p4port
The Perforce server to connect to (as host:port).
p4user
The Perforce user.
p4passwd
The Perforce password.
p4bin
An optional string parameter. Specify the location of the perforce command line binary (p4). You only need to do this if the perforce binary is not in the path of the buildbot user. Defaults to “p4”.
split_file
A function that maps a pathname, without the leading p4base, to a (branch, filename) tuple. The default just returns (None, branchfile), which effectively disables branch support. You should supply a function which understands your repository structure.
pollinterval
How often to poll, in seconds. Defaults to 600 (10 minutes).
histmax
The maximum number of changes to inspect at a time. If more than this number occur since the last poll, older changes will be silently ignored.

Example

This configuration uses the P4PORT, P4USER, and P4PASSWD specified in the buildmaster's environment. It watches a project in which the branch name is simply the next path component, and the file is all path components after.

     from buildbot.changes import p4poller
     s = p4poller.P4Source(p4base='//depot/project/',
                           split_file=lambda branchfile: branchfile.split('/',1),
                          )
     c['change_source'] = s