Does branch 0.4 support tag information.

Asked by Yuliang Bao

Sometime, I need to view tag information of bazaar repo, just link svn.
I thing tag informat is useful, because is clear than revno.I want to add to trac.

Does branch 0.4 support tag, or someone know how to modify source.

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Trac-Bzr Edit question
Assignee:
No assignee Edit question
Solved by:
Yuliang Bao
Solved:
Last query:
Last reply:
Revision history for this message
Martin von Gagern (gagern) said :
#1

Currently there is no support for bzr tags in trac-bzr. I'm not sure
about what kind of support would be desirable. I can think of the
following options:
* List tag names for commits in timeline and changeset viewer.
* Provide macro to list all tags for one or several branches.
* Provide wiki syntax to link to a named tag.
* Make tags appear as directories in the source browser.

Depending on what exactly you're trying to achieve, we can discuss the
method(s) most suitable for you, point out the relevant source code
fragments, and perhaps you can contribute a patch. Otherwise it depends
on when and if I find the time to implement this myself.

Revision history for this message
Yuliang Bao (buaabyl) said :
#2

Thanks for your answer.

> *List tag names for commits in timeline and changeset viewer.
It is ok, and changing of source no so much.
This like command {{{bzr log}}, tag will in log message which revno have tag.
But still matter : I can't list all tag.

> *Provide macro to list all tags for one or several branches.
Maybe implement the macro suck like [[BzrListTagged()]] is enough.
The result Just like command {{{bzr tag}}},and link to changeset.
But It is not the best way I wish.

> *Provide wiki syntax to link to a named tag.
I have not think this way before.

> *Make tags appear as directories in the source browser.
I try to add tag in '''browse source''' last month, but it seemed that this not flexible enough.It will hard to understand, because user not create directory named tag in repo, And if user create a directory named tag it will fail.So I give up this way and not finish modify source.
-----
May be macro is better.But I like add one entry '''Tag Info''' to timeline option
The orignal option is
{{{
View changes from ......
 Milestones
 Opened and closed tickets
 Repository checkins
 Wiki changes
}}}

It will like that
{{{
View changes from ......
 Milestones
 Opened and closed tickets
 Repository checkins
 Wiki changes
 Tag Info
}}}

And I still read trac source code.Python make things easy,but trac architecture is too complex, so may interface......

Revision history for this message
Martin von Gagern (gagern) said :
#3

In order to add a new kind of timeline event, one would have to implement the ITimelineEventProvider interface.
See http://trac.edgewall.org/browser/trunk/trac/timeline/api.py for a description of that interface.
The ChangesetModule in http://trac.edgewall.org/browser/trunk/trac/versioncontrol/web_ui/changeset.py has the implementation used for the repository commits, it might provide a good template to add another kind of timeline provider.

Feel free to add a whishlist item for this thing using the launchpad bug report facility. The same for any other kind of tag support you'd like to see.

It might make sense to implement ISearchSource as well, so people can search for tag names. See http://trac.edgewall.org/browser/trunk/trac/search/api.py for its interface description.

As for implementing the other approaches: Macro listing all tags should be feasible, and I'd suggest adding that functionality to the BzrWikiMacros class in trac-bzr. The same goes for a dedicated linking macro. Adding information to the timeline events corresponding to commits might be tricky, so a separate timeline provider would probably be easier and more flexible.

Having separate dirs for tags should be possible as well, as Trac never talks to the filesystem directly, but it would be a lot of work. And I'm not sure where these tag directories should be placed, as having them within the development tree would be bad in most cases. And calling the main tree "branch", "trunk" or whatever would add a level of directories for little gain, as most people might already have a dir containing different branches. Would require more thinking, and probably not worth the effort.

Revision history for this message
Yuliang Bao (buaabyl) said :
#4

Thank you. I will try to implement macro.

Revision history for this message
Yuliang Bao (buaabyl) said :
#5

I implement a macro in '''lp:~fishbaoyu/trac-bzr/BzrTagListMacro''', need testing... Thanks.

Revision history for this message
Yuliang Bao (buaabyl) said :
#6

I implement a macro in lp:~fishbaoyu/trac-bzr/BzrTagListMacro , need testing... Thanks.(last comment not clickable)