Build Number revisited

blr at robertsr.us blr at robertsr.us
Tue Nov 27 20:00:25 CST 2007


I sat down and figured out an easy way to get the build number off the central
repository.  This extension:

from mercurial import commands;

def buildnum(ui, repo, **kargs):
    commands.tip(ui, repo)

enabled on the server in an hgrc file (this is from
/usr/local/etc/mercurial/hgrc.d/buldnum.rc)

[hooks]

incoming = python:hgext.buildnum.buildnum

and every time a developer does 'hg push' they see 'hg tip' run on the central
repo.  Obviously, the sequential build number only applies to this branch.

I also have a simple wget from the hgwebdir.cgi that parses out the sequential
revision number and puts it into an html file that becomes part of the build,
but it's pretty site-specific and simple, so I didn't included it.

I like the idea (in response to my previous post) of log -k to get defect id's
into the build.  I plan to do that also.  But for now, management is accustomed
to a build number, and this is elegant enough to clear my kludge filter.

Thanks,
Barry



More information about the Mercurial mailing list