bugmap extension (was re: API question: ancestors of B that are not ancestors of A)

Greg Ward greg-hg at gerg.ca
Wed Dec 9 21:13:59 CST 2009


On Wed, Dec 9, 2009 at 7:42 PM, Nicolas Dumazet <nicdumz at gmail.com> wrote:
> 2009/12/10 Greg Ward <greg-hg at gerg.ca>:
>> I have already implemented a changeset/bug mapping, so I
>> can trivially lookup the bugs fixed by any changeset.  (It even handles
>> "ongoing" and "reverted" bugs in addition to "fixed".)
>
> I find this very interesting. A killer feature to integrate within a
> bug tracker.

Yeah, it is a pretty nifty extension, if I may say so myself.  ;-)
It's a carryover from our current CVS workflow, which mandates that
checkin messages start with "BZ#####" so that we can connect checkins
back to Bugzilla bugs.  There are two little problems carrying that
habit over to Mercurial: 1) developers are human and make errors, and
2) Mercurial's changelog is immutable: you cannot fix your errors.  So
I wrote 'bugmap' to track the changeset/bug mapping externally.  Once
that mapping gets into a relational DB (which happens when you push),
all sorts of interesting things become possible.  Like figuring out
which bugs are fixed in changeset B but not in A.  Or trivially going
from bug ID to a list of changesets.

The catch is that bugmap is currently fairly tightly connected to our
workflow policies and to MySQL.  It was just too hard (=
time-consuming) to make it properly generic, so I caved in and put our
local policy right in the extension.  ;-(  Probably fixable, but not
on my current schedule.

The other catch is there's an infinite recursion in there that is only
triggered by hgweb.  Have not sat down to figure out why.

Anyways, I'll attach the source for the extension if anyone is interested.

> I'm already imagining hooks flying off repos to trackers for automated
> reports; something that would make many engineers cry tears of joy and
> switch to mercurial for *this* feature.

Hey, Bazaar has 'commit --fixes', so I had to make 'commit --fix',
'commit --ongoing', and 'commit --revert'.  Just keeping up!  ;-)

Greg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bugmap.py
Type: text/x-python
Size: 25126 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20091209/48d71775/attachment.py>


More information about the Mercurial-devel mailing list