[Buildbot-devel] Filtering on Revision

David A. Greene greened at obbligato.org
Wed Nov 19 23:10:37 UTC 2008


I want to set up a BuildBot that builds every N SVN revision.  For example,
if N is 200, I'd llike to build at revisions 200, 400, 800, etc. when they 
occur.

I tried setting up a Scheduler Scheduler like this:

# Ignore changes that are not revision mod 200
def change_interval(change):
  if (change.revision == None)
    return False
  if (change.revision % 200 == 0)
    return True
  else
    return False

## configure the Schedulers

## Build every 200 commits
from buildbot.scheduler import Scheduler
c['schedulers'] = []
c['schedulers'].append(Scheduler(name="every200",branch=None,
                                 treeStableTimer=0,
                                 builderNames=["x86_64-linux"],
				 fileIsImportant=change_interval))

But buildbot checkvonfig complains:

Traceback (most recent call last):
  File "lib/python/buildbot/scripts/runner.py", line 855, in doCheckConfig
    ConfigLoader(configFile)
  File "lib/python/buildbot/scripts/checkconfig.py", line 31, in __init__
    self.loadConfig(configFile)
  File "lib/python/buildbot/master.py", line 487, in loadConfig
    exec f in localDict
  File "/buildbot/masters/mybuild/master.cfg", line 71
     if (change.revision == None)
^
 SyntaxError: invalid syntax

I'm new to Python and (obviously) BuildBot.

Is this the right way to go about things?  How should this kind of thing be 
done?

Thanks.

                                          -Dave




More information about the devel mailing list