Another Mercurial - Bugzilla Extension Setup Question
Jim Hague
jim.hague at acm.org
Thu Apr 25 13:34:13 UTC 2013
On Wednesday 24 Apr 2013 03:54:45 mmann964 wrote:
> I'm trying to setup the Bugzilla extension for Mercurial. When I do a
> commit, I don't see the Bugzilla hook being called.
>
> Here's my hgrc file:
>
> [extensions]
> hgext.bugzilla =
>
> [hooks]
> incoming.bugzilla = python:hgext.bugzilla.hook
Can I just check - is this the .hg/hgrc in the repository on the server you
are pushing to, or the .hg/hgrc in your local repository? The above needs to
be in the repo you are pushing to.
The rest of the configuration looks OK. I assume you have
[web]
baseurl=
defined somewhere.
I put the [bugzilla] part of the configuration into
/etc/mercurial/hgrc.d/hgbugzilla.rc, as I have several repos linked Bugzilla
and that part of the configuration is common between them all.
You won't see a report of the hook being called when you 'hg push', because
the hook is being run on the remote end.
The Bugzilla extension is intentionally not chatty. But it will report if
anything goes wrong. So if the extension was being called, I'd expect to see
either an error or success.
However, if the regexp isn't matching, then the extension will keep silent.
I've found that defining your own regexp is a bit of a minefield, and it can be
tricky to get right. Can you try using the default built-in regexp? That will
definitely match your sample commit message.
In fact, I just tried your RE now, and it's not matching as you expect.
$ python
Python 2.7.3 (default, Mar 4 2013, 14:57:34)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> bug_re=re.compile("Bug (?P<ids>\d+?)", re.IGNORECASE)
>>> m = bug_re.search("Bug 719 test")
>>> print m.group("ids")
7
Is there anything interesting in Bug 7 in your Bugzilla?
--
Jim Hague - jim.hague at acm.org Never trust a computer you can't lift.
More information about the Mercurial
mailing list