[Buildbot-devel] mercurial builds

Georges Racinet gracinet at anybox.fr
Tue Jul 31 10:38:41 UTC 2012


On Jul 31, 2012, at 5:03 AM, Oleg Smolsky wrote:

> Hey there, I've just got BuildBot working against my Mercurial repo:  
> changes are shown (they are pushed with the Hg extension and caught  
> with PBChangeSource), I can make forced builds. However,  
> SingleBranchScheduler is giving me grief.

Hi,

  from your traceback below, it looks like the Mercurial source step  
is the one you're having problems with.


>
> Here is the change coming in:
> 2012-07-30 19:30:21-0700 [Broker,3,127.0.0.1] perspective_addChange  
> called
> 2012-07-30 19:30:21-0700 [Broker,3,127.0.0.1] checking for User  
> Object from hg Change for: Oleg Smolsky <oleg at xxxxx.xxx>
> 2012-07-30 19:30:21-0700 [-] added change  
> Change(revision=u'1a2242c644fcf08728ee5524af0c6be9a03b6c5d',  
> who=u'Oleg  Smolsky <oleg at xxxxx.xxx>', branch=u'default',  
> comments=u"cblock: fixed an 'order' warning", when=1343701821,  
> category=None, project=u'', repository=u'http://hg.lan.colo/core')  
> to database
>
> A new build is initiated but the code dies in an assertion:
> 2012-07-30 19:31:22-0700 [-] BuildStep.failed; traceback follows
>         Traceback (most recent call last):
>           File "/opt/buildbot/sandbox/local/lib/python2.7/site- 
> packages/buildbot-0.8.6p1-py2.7.egg/buildbot/process/buildstep.py",  
> line 545, in _startStep_2
>             doStep.addCallback(self._startStep_3)
>           File "/opt/buildbot/sandbox/local/lib/python2.7/site- 
> packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/ 
> defer.py", line 301, in addCallback
>             callbackKeywords=kw)
>           File "/opt/buildbot/sandbox/local/lib/python2.7/site- 
> packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/ 
> defer.py", line 290, in addCallbacks
>             self._runCallbacks()
>           File "/opt/buildbot/sandbox/local/lib/python2.7/site- 
> packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/ 
> defer.py", line 551, in _runCallbacks
>             current.result = callback(current.result, *args, **kw)
>         --- <exception caught here> ---
>           File "/opt/buildbot/sandbox/local/lib/python2.7/site- 
> packages/buildbot-0.8.6p1-py2.7.egg/buildbot/process/buildstep.py",  
> line 551, in _startStep_3
>             if self.start() == SKIPPED:
>           File "/opt/buildbot/sandbox/local/lib/python2.7/site- 
> packages/buildbot-0.8.6p1-py2.7.egg/buildbot/steps/source/ 
> oldsource.py", line 291, in start
>             self.startVC(branch, revision, patch)
>           File "/opt/buildbot/sandbox/local/lib/python2.7/site- 
> packages/buildbot-0.8.6p1-py2.7.egg/buildbot/steps/source/ 
> oldsource.py", line 1206, in startVC
>             assert self.branchType == 'inrepo' or not branch
>         exceptions.AssertionError:

Are you using the older "slave-side" Mercurial step (http://buildbot.net/buildbot/docs/latest/manual/cfg-buildsteps.html#module-buildbot.steps.source 
, "Caution" paragraph)

>
> I have "branchtype" set to "inrepo", but that makes no difference -  
> the branch is correctly set to "default" anyway...
> [hgbuildbot]
> master = localhost:8000
> branchtype = inrepo

That's the hook config. I'd guess you set branch='default' in the  
Mercurial step definition, and forgot to add branchtype='inrepo'

>
> So, I hacked the assertion out and the build actually succeeds:
> root at gate:/opt/buildbot/sandbox/lib/python2.7/site-packages/ 
> buildbot-0.8.6p1-py2.7.egg/buildbot/steps/source# diff  
> oldsource.py.orig oldsource.py
> 1206c1206
> <             assert self.branchType == 'inrepo' or not branch
> ---
> >             #assert self.branchType == 'inrepo' or not branch
> 1208,1209c1208,1209
> <             if branch:
> <                 self.args['branch'] = branch
> ---
> >             #if branch:
> >             #    self.args['branch'] = branch
>
> Could somebody clarify how this is really supposed to work please?

That would probably not have worked with another branch than 'default'.
Here's a working config with the master-side source step, on 0.8.6p1 :

from buildbot.steps.source.mercurial import Mercurial
factory.addStep(Mercurial(
     repourl= "https://example.com/repos/core"
     mode='full',
     method='fresh',
     branchType='inrepo',
     haltOnFailure=True,
     description='hg:core',
     workdir='build/calculs.core',
     ))


Regards,
--
Georges Racinet
Anybox SAS, http://anybox.fr
Bureau: 09 53 53 72 97 Portable: 06 51 32 07 27
GPG: 0x33AB0A35, sur serveurs publics







More information about the devel mailing list