Fixed bugs not rendered as links

Bug #512733 reported by Martin von Gagern
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Trac-Bzr
Low
Martin von Gagern

Bug Description

The --fixes argument to bzr commit records a URL for the bug, which gets displayed in trac as a revision property called "bugs". It would be nice to have the URL rendered as a link instead of plain text. A property renderer to do so should be easy to write. It might even make sense to identify urls pointing to tickets of this trac setup, and render a shorter format for them.

Changed in trac-bzr:
importance: Undecided → Low
assignee: nobody → Martin von Gagern (gagern)
Changed in trac-bzr:
status: New → Triaged
Changed in trac-bzr:
milestone: none → 0.4.3
Revision history for this message
Oleg Frantsuzov (franoleg) wrote :

I've implemented the first part of this in the rev 118 of lp:~franoleg/trac-bzr/tagdisplay (sorry for the confusing name, I thought about playing with the display of tags when I created it).

I haven't decided yet what's the best way of detecting the links to the tickets of this Trac env. I don't feel like doing magic and comparing the revision bug link to the calculated URL of the Trac env. Maybe it'd be better to have an option with the regexp to match the revision bug links against?

I was also thinking about trying to add bug links next to the changeset in the timeline view, similar to how Mercurial plugin displays tags and brances, see http://trac.edgewall.org/timeline?from=2010-10-10T00%3A32%3A15%2B03%3A00&precision=second

I like the way QBzr displays tags and bugs in the log window, and want to achieve something similar.

Revision history for this message
Oleg Frantsuzov (franoleg) wrote :

> I was also thinking about trying to add bug links next to the changeset in the timeline view

Alas, looks like this is only possible in Trac 0.13, and even there it's nothing but a text label (no link). What's more, even Trac 0.13 shows only branch and tag labels there. So it isn't probably a good idea to abuse this and put bug IDs there.

That pretty much destroys the original idea.

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.

Changed in trac-bzr:
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers