Search code examples
testingmercurialbuildbot

buildbot not updating mercurial to latest head on forcebuilds


I have some scripts run after changes are pushed through a timer and they worked fine in using the proper head, but a force build after those had completed did not succeed. The same slave is being used. Here is a wrapper command for pull/update in master.cfg,

def repo_update( conf ):
    repo = "ssh://buildbot@repo//Users/buildbot/repo"
    repository = Mercurial( repourl=repo, branchType='inrepo', defaultBranch='devel')
    conf.addStep( repository )
    return

In the log it executes the following commands,

/usr/local/bin/hg pull --verbose ssh://buildbot@repo//Users/buildbot/repo
/usr/local/bin/hg identify --num --branch
/usr/local/bin/hg paths default
/usr/local/bin/hg update --clean --repository build --rev 15f87a21bf8aa00d642c2ebbd73a6da161815eaa
/usr/local/bin/hg identify --id --debug

Both logs have the same list of commands and they execute fine. But, in the forcebuild the script has a different argument for --rev --an older head; I'm not even sure where it is grabbing that number, it's not mentioned anywhere else in the script or logs, must be coming from the server, but how do I specify the head or NOT specify it? Am I adding the proper step to the repo?


Solution

  • I had the same problem until I added alwaysUseLatest=True. In your case I suppose you could use:

    repository = Mercurial(
        repourl=repo, 
        branchType='inrepo',
        defaultBranch='devel', 
        alwaysUseLatest=True
    )