How to disable Revision Log Link

Asked by natewlew

I really like using Trac and Bzr. I have a problem when viewing the revision log inside of a branch. If I click on the Revision log link when nested inside of a branch my server will run out of memory and lock up. I added ram and memory but that just buys me a little more time.

Example:

Main branch: Test_App/
Nested Branch: Test_App/Library

If I view the log for the main branch everything is fine. If I drill down into a directory (Nested Branch) and view the log, memory will climb until it runs out. This branch has about 1000 revisions.

My question is, would it be possible to remove the revision log link when nested inside a branch. The link would only show when I am in the main branch?

I am running:

Ubuntu 8.04
Apache 2.2.8 with Wsgi
Bzr 2.3.4
Python 2.5.2
TracBzr 0.4.2

Could someone show me how to do this or where at in the code to get started? I didn't what to file a bug on this because I read that Bzr uses a lot of memory when viewing the revision log.

Thanks

Question information

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

Nested branches are completely unsupported at the moment:
http://pypi.python.org/pypi/TracBzr#hidden-nested-branches
I guess I could fix that single issue, but I'd expect a large number of
other problems to spring up, some of them almost impossible to fix.
So I suggest you recondigure your layout in such a way that it can do
without nested branches.

Revision history for this message
natewlew (natewlew) said :
#2

Maybe Nested Branch was the wrong term. I didn't realize there was a term for Nested Branch (I do apologize).

I am just referring to a folder inside a branch.

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

Trac-bzr as it is is only a revision control backend to trac. So it doesn't decide where to place links, just how to compute the informatoon for these links. This leaves you with basically four options:

1. Try to make revision logs more performant. This is the best but also the hardest solution. Currently trac-bzr scans all revisions and checks if they touch the given dir, iirc. So speed depends on overall number of revs, while mem should be limited by number of matching revs. The rewlevant code is BzrVersionedNode.get_history.
http://bazaar.launchpad.net/~trac-bzr-team/trac-bzr/trunk/view/117/tracbzr/backend.py#L950

2. Change the get_history function to return bogus data, e.g. no changes at all. Would probably cause a lot of confusion.

3. Configure the HTTP server to redirect requests for these revision logs to some other page. E.g. use mod_rewrite under Apache.

4. Change trac itself, so it doesn't generate these links. Look for '.log(' in the sources, e.g.
http://trac.edgewall.org/browser//branches/0.12-stable/trac/versioncontrol/templates/dir_entries.html#L19
http://trac.edgewall.org/browser//branches/0.12-stable/trac/versioncontrol/web_ui/browser.py#L472
In these cases, the addition of the link would have to become conditional instead.

5. Use a site.html Genshi template to remove the links again.
http://trac.edgewall.org/wiki/TracInterfaceCustomization#SiteAppearance

Revision history for this message
natewlew (natewlew) said :
#4

Thanks for your help. This will be a good start.