Can't view changesets on branches

Bug #267700 reported by Daniel Nyström
12
Affects Status Importance Assigned to Milestone
Trac-Bzr
Fix Released
Low
Unassigned

Bug Description

I'm unable to view changesets on branches. Trunk is all fine. My repo looks like this:

/trunk
/branch1
/branch2

Both branch1 and branch2 (which both branched trunk once in a time) causes tracebacks, but the trunk is fine.

Versions:
Bzr: 1.6.1 (all repos are in meta directory format 1, working tree format 4 and branch format 6)
Trac: 0.11stable-r7510
Python: 2.4.4

Full traceback:
 Trac detected an internal error:

AttributeError: 'BzrRepository' object has no attribute 'repo'

File "/usr/lib/python2.4/site-packages/Trac-0.11stable_r7510-py2.4.egg/trac/web/main.py", line 424, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/Trac-0.11stable_r7510-py2.4.egg/trac/web/main.py", line 198, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/lib/python2.4/site-packages/Trac-0.11stable_r7510-py2.4.egg/trac/versioncontrol/web_ui/changeset.py", line 291, in process_request
  req.check_modified(chgset.date, [
File "build/bdist.linux-i686/egg/tracbzr/backend.py", line 456, in rev_older_thanFile "build/bdist.linux-i686/egg/tracbzr/backend.py", line 1227, in getattribute

Revision history for this message
Daniel Nyström (speakman) wrote :
Revision history for this message
Daniel Nyström (speakman) wrote :

An update: It seems like the whole "branch1" is not the problem, because "branch1,14" might work but "branch1,20" won't.
I'm totally clueless.

Revision history for this message
Toshio Kuratomi (toshio) wrote :

Can you try this patch and see if it works? I ran into a similar traceback when looking at::
  https://bugs.launchpad.net/trac-bzr/+bug/274609

I think this patch will fix this bug as well.

Revision history for this message
Daniel Nyström (speakman) wrote :

This caused this error message:

Trac detected an internal error:
NotBranchError: Not a branch: "/srv/bzr/repo/myproject/".

Revision history for this message
Toshio Kuratomi (toshio) wrote :

Hmmm... what else can you tell me about your setup? is "/srv/bzr/repo/myproject/" a branch? is it a shared repo? Is it in a shared repo? How does "myproject" relate to

/trunk
/branch1
/branch2

referenced earlier?

do you have steps to reproduce this error?

If the error is coming from the new code I've added, I should be able to track this down with a test case that reproduces the internal error.

Revision history for this message
Daniel Nyström (speakman) wrote :

Sorry for the spare description...

/srv/bzr/repo/myproject is a share repository, and trunk/ , branch1/ , branch2/ is branches within it.
trac-bzr is pointed at /srv/bzr/repo/myproject which makes all branches visible in Trac.

This worked very well before your patch was merged. After it showed the cited error message. I didn't had time to investigate further at that moment, so I just reverted back when it didn't work.

Anything else you want me to try out?

Thanks for looking into this, btw. :-)

Revision history for this message
Toshio Kuratomi (toshio) wrote :

Well, I'll be very unhappy if I start triggering the bug unexpectedly after deploying it to my trac :-).

The rest of my week is shaping up to be very busy, though, :-( If no one else has started looking into this, I should have more freedom on Sunday to get back into it.

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

I encountered this as well. Did you quick poke to the code so it does not crash anymore. Not a fix to the actual reason (why self.repo is not available for some of the node types?) but seems to cure the symptom (I did not find a changeset that crashes):

=== modified file 'tracbzr/backend.py'
--- tracbzr/backend.py 2009-01-19 16:42:31 +0000
+++ tracbzr/backend.py 2009-02-02 20:00:35 +0000
@@ -467,7 +467,7 @@
         if second_before_first:
             return False
         # Bah, unrelated revisions. Fall back to comparing timestamps.
- return (self.repo.get_revision(rrev1).timestamp <
+ return hasattr(self, 'repo') and (self.repo.get_revision(rrev1).timestamp <
                 self.repo.get_revision(rrev2).timestamp)

Changed in trac-bzr:
status: New → Confirmed
Revision history for this message
James Teh (jteh) wrote :

I think this is the correct fix. There is no bzr repository ("repo" attribute) on a BzrRepository trac object because one BzrRepository could encompass multiple physical bzr repositories. Thus, we have to get the bzr repository for the branches in question.

Revision history for this message
Rocky Burt (rocky-burt) wrote :

I'd like to make the suggestion for you to upgrade to latest stable Trac (currently 0.11.3) and latest stable Bzr (currently 1.12). After upgrading if you could test out lp:~rocky-burt/trac-bzr/bug-263300 to see if you're still having problems, that'd be great. Perhaps re-paste a traceback if you're still having problems that can be followed with more recent code.

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

James, you are right, using the repositories seems to be the correct fix here. Committed to trunk. Thanks for the merge directive!

Rocky, I'm not sure what your bug 263300 branch has to do with this. I see no connection.

Changed in trac-bzr:
importance: Undecided → Low
milestone: none → 0.3.0
status: Confirmed → Fix Committed
Changed in trac-bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.