Does not work with bzr 1.6

Bug #263300 reported by Gediminas Paulauskas
28
Affects Status Importance Assigned to Milestone
Trac-Bzr
Fix Released
Medium
Unassigned
trac-bzr (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Trying to view a changeset, annotate, revision log results in a traceback because of symbol removed in bzr 1.6

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.5/site-packages/trac/versioncontrol/web_ui/changeset.py", line 267, in process_request
    prev = repos.get_node(new_path, new).get_previous()
  File "/usr/lib/python2.5/site-packages/trac/versioncontrol/api.py", line 394, in get_previous
    for p in self.get_history(2):
  File "/var/lib/python-support/python2.5/tracbzr/backend.py", line 734, in <genexpr>
    return (y for x, y in izip(range(limit), history_iter))
  File "/var/lib/python-support/python2.5/tracbzr/backend.py", line 739, in _get_history
    history = list(self._merging_history())
  File "/var/lib/python-support/python2.5/tracbzr/backend.py", line 698, in _merging_history
    weave = self.tree._get_weave(self.entry.file_id)
AttributeError: 'RevisionTree' object has no attribute '_get_weave'

Related branches

Revision history for this message
Andrew Schulman (andrex) wrote :

I also see have this problem with bzr 1.5.1, trac-bzr 0.2+bzr45. I first saw it with bzr 1.6.1 rc1, so I reverted to bzr 1.5.1 and removed all of the .bzr directories, but now I'm still seeing the same error.

Revision history for this message
Andrew Schulman (andrex) wrote :

... Or, sometimes the error is "AttributeError: 'RevisionTree' object has no attribute '_revision_id'". And, sometimes I can navigate and view logs just fine. It seems to be random.

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

from the bzr NEWS file, 0.90rc1 release::

    * RevisionTree.get_weave is now deprecated. Tree.plan_merge is now used
      for performing annotate-merge. (Aaron Bentley)

Unfortunately, the Tree object does not have a plan_merge() method....

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

It looks like there's a fix on this branch::
   http://bazaar.launchpad.net/~menesis/trac-bzr/menesis-dev/revision/50

I'm not sure it's the correct fix, though. I think it's removing functionality to work around the problem. I'm not intimately familiar with either bzr or trac, though, so that might not be a correct assessment.

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

Okay, try this patch. It gets ancestry information from the repository instead of from the weave. It stops the tracebacks here.

Revision history for this message
.:. brainsik (brainsik) wrote :

Tried it, and now I get a different error:

AttributeError: 'KnitPackRepository' object has no attribute 'get_revision_graph'

Revision history for this message
Jack Moffitt (metajack) wrote :

Here is an improved patch which fixes the get_revision_graph() problem as well as the original one.

Revision history for this message
Jack Moffitt (metajack) wrote :

Ugh. This was already fixed in lp:trac-bzr trunk and no one updated the bug. It's fixed as of revision 49.

Can we get a new release made?

Revision history for this message
.:. brainsik (brainsik) wrote :

If you want, you can grab the release I just rolled out. It is the latest revision (revision 49) of lp:trac-bzr. It also includes a patch get rid of this _get_weave bug.

You can get via apt:

# DevSuki packages (backports, fixes, etc.)
deb http://packages.devsuki.com/ubuntu/ hardy main
deb-src http://packages.devsuki.com/ubuntu/ hardy main

or by direct download:

http://packages.devsuki.com/ubuntu/pool/main/t/trac-bzr/trac-bzr_0.2+bzr49-0devsuki2_all.deb

and the sources, diff, etc. are all here:

http://packages.devsuki.com/ubuntu/pool/main/t/trac-bzr/

Revision history for this message
Andrew Schulman (andrex) wrote :

Sorry, but I'm running trac-bzr 0.2+bzr49-1 (the Debian experimental package) with bzr 1.6.1-1, and I still get

  AttributeError: 'RevisionTree' object has no attribute '_get_weave'

when I try to view a revision log.

Please see my question #52270 about this.

Thanks,
Andrew.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

You can't simply use Repository.get_ancestry() here - that'll get the ancestry of the specific revision in the full repository graph, not in the one in the file revision graph.

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

So going through the tests we can see the bug being reproduced with test_node.test_get_history. Simple reproduction with with Bzr 1.12 shows:

$ nosetests tracbzr.tests.test_node
No handlers could be found for logger "bzr"
.E.
======================================================================
ERROR: test_get_history (tracbzr.tests.test_node.TestNode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rocky/dev/bzr/forks/TracBzr/vendor-main/tracbzr/tests/test_node.py", line 49, in test_get_history
    list(node.get_history()))
  File "/home/rocky/dev/bzr/forks/TracBzr/vendor-main/tracbzr/backend.py", line 756, in _get_history
    history = list(self._merging_history())
  File "/home/rocky/dev/bzr/forks/TracBzr/vendor-main/tracbzr/backend.py", line 715, in _merging_history
    weave = self.tree._get_weave(self.entry.file_id)
AttributeError: 'RevisionTree' object has no attribute '_get_weave'

----------------------------------------------------------------------
Ran 3 tests in 0.758s

FAILED (errors=1)

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

I have a proposed fix for this sitting in lp:~rocky-burt/trac-bzr/bug-263300

Revision history for this message
ToniMueller (support-oeko) wrote :

Contrary to comment #8, this is not fixed as of

$ dpkg -l bzr trac-bzr
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============================================-==============================================================
ii bzr 1.13.1-1~bpo50+1 easy to use distributed version control system
ii trac-bzr 0.2+bzr56~bpo50+1 Bazaar version control (bzr) backend for Trac

Revision history for this message
ToniMueller (support-oeko) wrote :

I wanted to say: Maybe it works with bzr 1.6, but it doesn't work with bzr 1.13, on my installation.

Revision history for this message
Guillaume Hain (zedtux) wrote :

Thanks brainsik for your packages !

I have install the package :
http://packages.devsuki.com/ubuntu/pool/main/t/trac-bzr/trac-bzr_0.2+bzr54-0devsuki2_all.deb

And it work perfectly on my Ubuntu Server 8.10, hosting trac 0.11.5 !

Revision history for this message
Guillaume Hain (zedtux) wrote :

I forget also to say thanks to Jack Moffitt for his patch that solve my second issue, on opening Browse Source screen ! :)

Revision history for this message
Jack Moffitt (metajack) wrote : Re: [Bug 263300] Re: Does not work with bzr 1.6

> I forget also to say thanks to Jack Moffitt for his patch that solve my
> second issue, on opening Browse Source screen ! :)

Glad I could help.

jack.

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

The _get_weave issue has been resolved for some time now, although not as early as comment #8 suggests, but since http://bazaar.launchpad.net/~trac-bzr-team/trac-bzr/trunk/revision/68

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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