[Buildbot-devel] Problems getting svnpoller.py to work

Robert Mecklenburg rmecklenburg at s5w.com
Fri Dec 15 23:38:25 UTC 2006

I'm new to buildbot and I'm having trouble configuring it.  My set up
is ubuntu/edgy my master and slave on the same host (using different
accounts).  I've got them setup so a forced build works, but when I
try to get buildbot to initiate a build triggerred by an svn checkin
I'm having problems.

Here is the relevant part of the master.cfg file:

c['schedulers'].append(Scheduler(name="trunk", branch=None,

I'm using using svnpoller.py run from cron to invoke sendchange.  When
the poller sees a change it seems to run correctly and I see this in
the twistd.log file:

 2006/12/15 13:03 MST [Broker,1,] perspective_addChange called
 2006/12/15 13:03 MST [Broker,1,] adding change, who mecklen, 1 files, rev=2342, branch=trunk, comments Explain the catch block.
 2006/12/15 13:03 MST [Broker,1,] <Scheduler 'all' at -1216969460> ignoring off-branch <buildbot.changes.changes.Change instance at 0xb75232cc>

It seems the scheduler is ignoring the change request due to a bad
branch comparison.  On further investigation it seems that in
scheduler.py Scheduler.addChange the line

	if change.branch != branch:
            log.msg("%s ignoring off-branch %s" % (self, change))

is true causing the ignore.  The value self.branch is None and
change.branch is "trunk".  So I changed the if to:

        if self.branch is not None and change.branch != self.branch:

There was a post on July 21 from Charles Hardin (wasn't that Buddy
Holly's real name?) with the same patch in it.  When I ran the new
code, I then got errors on the checkout:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/buildbot/process/step.py", line 654, in startStep
  File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 191, in addCallback
  File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 182, in addCallbacks
  File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 307, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
--- <exception caught here> ---
  File "/usr/lib/python2.4/site-packages/buildbot/process/step.py", line 677, in _startStep_2
    skip = self.start()
  File "/usr/lib/python2.4/site-packages/buildbot/process/step.py", line 1444, in start
    self.startVC(branch, revision, patch)
  File "/usr/lib/python2.4/site-packages/buildbot/process/step.py", line 1721, in startVC
    assert not branch # we need baseURL= to use branches

The error occurs in an asser in step.py SVN.startVC contains:

        if self.svnurl:
            assert not branch # we need baseURL= to use branches
            self.args['svnurl'] = self.svnurl

The assert is tripping with
  2006/12/15 15:12 MST [Broker,0,] svnurl = svn://svn/svn/s5w/trunk/s5w
  2006/12/15 15:12 MST [Broker,0,] baseURL = None
  2006/12/15 15:12 MST [Broker,0,] branch = trunk

So I changed the assert to:

        if self.svnurl:
            assert branch == "trunk" or not branch # we need baseURL= to use branches
            self.args['svnurl'] = self.svnurl

Now the system works and correctly responds to svn checkins.  But I'm
having trouble believing I did the Right Thing (tm).


Robert Mecklenburg

More information about the devel mailing list