[Buildbot-devel] Filtering on Revision

David A. Greene greened at obbligato.org
Thu Nov 20 23:43:19 UTC 2008


On Wednesday 19 November 2008 17:10, David A. Greene wrote:
> 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

Ok, I fixed the colon-before-indent problem.

I added some logging:

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

Now I get this error:

2008-11-20 17:40:15-0600 [-] _finished : [Failure instance: Traceback: <type 
'exceptions.TypeError'>: int argument required
[...]
        master.cfg:73:change_interval

That's pointing to the log output.

If change.revision isn't an integer, what is it?  How do I extract an integer 
value to do comparisons?  The BuildBot documentation doesn't really talk about 
what a Change is.  Even the API docs are vague.

Thanks.

                                           -Dave




More information about the devel mailing list