Comment 3 for bug 512733

Revision history for this message
Martin von Gagern (gagern) wrote :

> I've implemented the first part of this in the rev 118 of lp:~franoleg/trac-bzr/tagdisplay

Thanks for the bug number rendering. Included that in my own branch for this.

> I don't feel like doing magic and comparing the revision bug link to the calculated URL of the Trac env.

I like the magic bug link shortening based on Trac env, and have implemented it in lp:~gagern/trac-bzr/bug512733-tagdisplay (keeping your confusing name to indicate the relation). That way, ticket numbers will be rendered nicely in most of the situations without any need for custom configuration.

When you want things configurable, then I believe you also want support for more than one tracker. In that case, there are several possible routes to obtain the required map from regexp to rendering.
* Add some config interface. Might be hard, as you'd need to somehow encode a list of regexp-rendering pairs.
* Use a dedicated wiki page. The Trac InterWiki links use that approach, see http://trac.edgewall.org/wiki/InterWiki
* Use the bazaar configuration, and reverse that process, returning e.g. "lp:512733" style renderings.
I'm not sure which of these would be most appropriate. I'm open for discussion.

> So it isn't probably a good idea to abuse this and put bug IDs there.

You might try to request appropriate infrastructure from the Trac devs, or propose a patch to them. trac.versioncontrol.web_ui.ChangesetModule.render_timeline_event would probably the place to adjust.
If you file a request upstream, please post a link here for reference.