trac-bzr 0.3.0

Martin von Gagern Martin.vGagern at gmx.net
Fri Jan 22 11:08:55 GMT 2010


Hi Michael!

On 22.01.2010 12:26, Michael Gliwinski wrote:
> I do have a couple of questions if you don't mind.

Sure. If you don't mind, I might turn some of them into FAQ items at
https://answers.launchpad.net/trac-bzr if the need for it arises.

> 1. revisions are showing up in form PROJECT,BRANCH,REVNO; from the HACKING 
> document I gather this is expected, yes?  the question is, when using 
> TracLinks to refer to say, a specific revision of a specific file, do you 
> also have to use this form?

Yes, this is expected if your branch is in directory PROJECT/BRANCH
under the configured repository root. Slashes are simply converted to
commas.

You also have to use that form for trac links, and have to note that the
bracket notation for changelogs won't work at all, as noted in the
README or at http://pypi.python.org/pypi/TracBzr#bracket-syntax

> 2. do you think there would be some way to avoid that when there is enough 
> context?  e.g. if I have a link like [source:/project/branch/path/to/file at 10] 
> then could the branch not be determined from the path?

I don't think so. The problem is that Trac poses questions to the
repository without providing too much context info. So in the above
case, it might want to include a "Next version" link, and therefore ask
the repo "please tell me the version number after version 10". It
doesn't give a path for this, as it assumes version numbers to be global
for the whole repository (as they are for svn), and bzr can't answer
that kind of question without knowing the branch. Maybe revision 10 is
the last one?

I guess we could try to perform SOME operations with limited knowledge
about the version, but I'd rather have the tool fail outright than
trying to have half-supported features.

A better approach might be the planned multi-repo support in Trac 0.12.
Together with a planned refactoring of trac-bzr (which I outlined in
https://blueprints.launchpad.net/trac-bzr/+spec/multirepo ) this should
give Trac a collection of simple single-branch repositories. I haven't
looked at the multirepo work in Trac yet, so I don't know what syntax
they will use, but I trust they'll come up with something appropriate.

Yet another alternative would be writing your own wiki syntax parser.
Then you could write [tracsource:/foo/bar/baz at 10] and that component
could translate that into a link to the browser with full revision
identification. I don't plan to write such a thing, as I hope Trac 0.12
makes it unneccessary, but if there were urgent need, that's the path
I'd suggest to people. And I'd be willing to accept contributions here.

> 3. revisions in the source browser show up as PROJECT,BRANCH,REVNO; while when 
> using the Branches macro they show up simply as [REVNO]; any way to make the 
> source browser behave the same way?

I've thought about this as well. The complete revision has to be in the
link href, but not necessarily in the text. For the macro, trac-bzr
generates the html fragment, and can make this distinction. The browser
listings are generated by a Trac template, which takes the same
attribute for link and text. So nothing trac-bzr does by itself (short
of REALLY EVIL call stack introspection) can make a distinction there.

At least for Trac 0.11 there is the possibility to have a component
register a postprocessing hook. Then one could write a Genshi template
to reformat such links. I guess I'd do this one day, but don't know
when. If you want to, feel free to open a whishlist bug report.

> 4. failed to get the primary_branches setting working; I have it set 
> to 'trunk,[0-9]*,' but still PROJECT/some_feature shows up before 
> PROJECT/trunk; any tips on debugging it?  (I have trac's debug log enabled 
> but nothing relevant in there)

Include the PROJECT part. Set it to "*/trunk,*/[0-9]*".

> I haven't had a look at the code yet, am a bit pressed for time ATM, but I'll 
> try to have a look soon.

Sure, thanks. I'll in turn have a look at any useful contributions you
might have to offer.

Greetings,
 Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20100122/0876d52e/attachment.pgp 


More information about the bazaar mailing list