Linking from Mercurial web GUI to a bug rapporting system
Yuya Nishihara
yuya at tcha.org
Fri Jan 6 13:39:57 UTC 2012
Shane Turner wrote:
> On 05/01/2012 12:31 PM, Yuya Nishihara wrote:
> > Tri4 Calendar wrote:
> >> I've used this link to help me make my solution:
> >> http://blog.gmane.org/gmane.comp.version-control.mercurial.general/month=20090501/page=46
> >>
> >> In my hgweb.config I have added the following:
> >>
> >> [extensions]
> >> interhg =
> >>
> >> [interhg]
> >> jira = s!([A-Z][A-Z])-(\d*)!<a
> >> href="http://jira:8080/browse/\1-\2"><font<http://jira:8080/browse//1-/2%22%3E%3Cfont>color="magenta">\1-\2</font></a>!
> >>
> >> - But the hgweb.cgi pages log list (links) over changesets is stopped
> >> by the new Jira hyperlink. Also if the Jira number is in front then it is
> >> not possible to click and see the changeset in full as one normally would.
> > It's the limitation of interhg, which just replaces a HTML string by
> > pattern matching.
> > As a result of replacement, changeset link gets nested:
> >
> > <a href="/path/to/changest"><a href="/path/to/jira">PO-xxxx</a>changest comment</a>
> >
> > Because HTML standard doesn't allow nested<a> tag, the result depends on
> > browsers. IIRC, Chrome ignores nested<a> tag, but Firefox tries to render it.
> >
> > I don't have an idea to work around this issue.
> >
> > Regards,
> I'm unfamiliar with interhg, but maybe something similar to the
> following would work? What I'm trying to do is
> 1. grab the portion before the JIRA text
> 2. prepend the new link with the text for the JIRA text
> 3. restore the original text
>
> jira=s!(<a href=[^>]*>)(.*)([A-Z]+-\d*)!<a
> href="http://jira:8080/browse/\3">\3</a> \1\2\3!
Maybe it won't work.
Interhg hooks 'escape'-filter of hgweb's template, which doesn't include <a> tag
for changeset link:
http://selenic.com/repo/hg/file/tip/mercurial/templates/paper/shortlogentry.tmpl#l4
(see around {desc|strip|firstline|escape|...)
Possibly you can write custom template with filter for JIRA link...
Regards,
More information about the Mercurial
mailing list