[Buildbot-devel] darcs revisions

Dmitry Nezhevenko dion at dion.org.ua
Fri Jul 15 06:41:12 UTC 2011

On Thu, Jul 14, 2011 at 08:42:57PM -0700, Ian Zimmerman wrote:
> So, I would like to somehow disable that, probably by sub-classing the
> Darcs step and doing something more like the CVS step with timestamps.
> But I don't understand what part of buildbot actually constructs these
> monstrous "revisions".  The Darcs step doesn't implement
> computeSourceRevision(), so where is it coming from?

It looks like you are looking to "master" code. AFAIK this piece of code
is used only when _triggering_ build to find out target revision to

But in case of git/hg-like DVCS it's a bit more difficult. Imagine that
changesource got two revisions from: "a1f..." and "9af..." and it was
decided to merge two build requests to save some machine time. So buildbot
needs to choose target revision to "update" that will be passed to "hg
update". In such case computeSourceRevision() should be implemented some
how non-trivial way because you can't just sort such commit id's

At the same time, buildbot has "got_revision" term. It usually equal to
target revision described above. But in some case it may be different. It
may happens that VCS can't update to requested revision due to some
reason (maybe somehow related to it's architecture, etc). Also
got_revision is important when you're triggered build without specifying
revision. In such case buildbot will try to update to latest and good VCS
plugin should set got_revision that is's actually got after update.

got_revision is calculated on "slave". Then this info is transfered to
master. As about darcs, it looks like followed code is used:

	def parseGotRevision(self):
		darcs = self.getCommand('darcs')

		# we use 'darcs context' to find out what we wound up with
		command = [darcs, "changes", "--context"]
		c = runprocess.RunProcess(self.builder, command,
				 os.path.join(self.builder.basedir, self.srcdir),
				 environ=self.env, timeout=self.timeout,
				 sendStdout=False, sendStderr=False, sendRC=False,
				 keepStdout=True, usePTY=False)
		d = c.start()
		d.addCallback(lambda res: c.stdout)
		return d

But before changing it to return some "date" instead of real info, please
also take a look to doVCFull() method in same file. Info that you will
return as revision may be passed to doVCFull in future (for example
rebuild action).

So you'll need to tweak it too. Then you'll probably need to tweak
changesource to generate some style of rev. id...

WBR, Dmitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://buildbot.net/pipermail/devel/attachments/20110715/1cc5be22/attachment.bin>

More information about the devel mailing list