Convert bug numbers to links in descriptions for hgweb; set bugtracker in [web]

Edward Lee edilee at mozilla.com
Sun Sep 2 22:47:19 CDT 2007


This patch converts bug-like numbers in descriptions to be links if
the configuration [web] section has a "bugtracker" value. Updates
default and gitweb templates.

Commit messages can have references to bug numbers that contain useful
discussions, so providing a link to the bug lets people viewing the
repository get a bigger picture easier. The patch looks in the
description for text like bug 1, bug #1, b=1, #1234, 2007; so there
might be false positives, but that's not too bad.

I added the "bug" filter in hgmod_web.py because it needed to use a
configuration value that's not easily accessible from templater.py.
Additionally, filters that don't actually exist won't get applied, so
an unset bugtracker will have the "bug" filter do nothing.

Example .hgrc:
[web]
bugtracker = https://bugzilla.mozilla.org/show_bug.cgi?id=

The default and gitweb templates use "desc" in different places, but
all the non-link uses of desc should now be bug-ifyable. (I avoided
making nested links which work but are messy...)

Ed
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bugzilla.txt
Url: http://selenic.com/pipermail/mercurial/attachments/20070902/98e647be/attachment.txt 


More information about the Mercurial mailing list