[Buildbot-devel] Buildbot 0.7.11p3 / Perforce

Douglas Leeder douglas.leeder at sophos.com
Tue Nov 24 10:52:48 UTC 2009


> -----Original Message-----
> From: Chris Lees [mailto:clees at ittvis.com]
> Sent: 23 November 2009 23:42
> To: buildbot-devel at lists.sourceforge.net
> Subject: [Buildbot-devel] Buildbot 0.7.11p3 / Perforce
>
> Hi List Members,
>
>
>
> Below is an example of one perforce poller watching a projects
> directory within the projects directory there are two branches. Branch
> one is trunk and branch two is integration, under each branch is
> ProjectA which contains similar source and is the same project. Trunk
> contains a stable version of ProjectA and Integration contains a
> constantly modified version of ProjectA. If I only want to fire off the
> Integration scheduler when a submit changes for that particular branch
> what should below look like?
>
>
>
> Currently what happens is all schedules watching branches with similar
> directory structures get fired off causing all builders to start
> building.
>
>
>
> poller = P4Source(p4base='//depot/projects/', p4port=p4env['port'],
> p4user=p4env['user'],
>
>                       p4passwd=p4env['passwd'],
> p4bin='/rserver/local/linux/x86/bin/p4',
>
>                       pollinterval = 60, split_file=lambda branchfile:
> branchfile.split('/',1),)
>
>
>
> Trunk = Scheduler(name="Trunk",
>
>                            branch='trunk/ProjectA',
>
>                            treeStableTimer=30,
>
>                            builderNames=’TrunkBuilders’)
>
>
>
> Integration = Scheduler(name="Integration",
>
>                            branch='integration/ProjectA',
>
>                            treeStableTimer=30,
>
>                            builderNames=’IntegrationBuilders’)
>
>
>
> Any help offered is appreciated all I really care to do is get a handle
> on the change sent to the change master and trigger the correct
> scheduler based on the branch with the change.
>

I'm surprised you're getting any builds.

It looks to me like your split_file function is wrong, as the branch section will never have a slash in it, whereas your branch lines
have slashes in them.

I'd suggest splitting the split_file into a real function rather than a lambda, then writing some test cases, to ensure the function splits
the path into branch and project file path correctly.


--
Douglas Leeder



Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.


More information about the devel mailing list