Interhg Extension
This extension is distributed with Mercurial.
Author: Ohashi Hideya
Overview
The `interhg' Mercurial extension allows you to use shortcut expressions in your changelog and summary texts that are automatically expanded into links or any other arbitrary expression, just like what InterWiki does.
Configuration
Configure your .hgrc to enable the extension by adding the following lines:
[extensions] interhg =
These are some example patterns (link to bug tracking, etc.)
[interhg] issues = s!issue(\d+)!<a href="http://bts/issue\1">issue\1</a>! bugzilla = s!((?:bug|b=|(?=#?\d{4,}))(?:\s*#?)(\d+))!<a..=\2">\1</a>!i boldify = s/(^|\s)#(\d+)\b/ <b>#\2<\/b>/
Add any number of names and patterns to match
Comments
As of hg 0.9.5, there are some problems when using interhg to implant links into commit comments display:
- on the changeset view, it breaks the title line (line above "author:") because the a.title css uses "display:block". Looks ugly.
on the shortlog view, it only links the text left of the interhg link to the changeset (there is also a changeset link in another column, so no big problem). this is maybe because it nests <a> tags which is not allowed in HTML. Better would be to close and reopen the outer tag. You can try to do this in the regex, but it will break the RSS feed.