Edgewall Software

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10908 closed defect (fixed)

AttributeError: 'changectx' object has no attribute 'bookmarks'

Reported by: r.rossmair Owned by: Christian Boos
Priority: normal Milestone: plugin - mercurial
Component: version control/changeset view Version: 1.0-stable
Severity: normal Keywords: Mercurial
Cc: r.rossmair Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

This error is issued by TracMercurial every time I want to view a changeset. Used to work until recently, apparently a Trac or TracMercurial update broke things.

Trac revision is 11406.

While doing a GET operation on /changeset/b6da56b443c458c07b51b720f9a2e777deff6beb/visureal-classic, Trac issued an internal error.

Request parameters:

{ new : u b6da56b443c458c07b51b720f9a2e777deff6beb ,   new_path : u /visureal-classic } 

User agent: Mozilla/5.0 Windows NT 6.1; WOW64; rv:17.0 Gecko/17.0 Firefox/17.0

System Information

Trac 1.0.1dev-r0
Babel 0.9.6
Genshi 0.6 without speedups
Mercurial 1.6.4
mod_wsgi 3.3 WSGIProcessGroup WSGIApplicationGroup %{GLOBAL}
Pygments 1.3.1
pysqlite 2.6.0
Python 2.6.6 r266:84292, Dec 27 2010, 00:18:12 br GCC 4.4.5
setuptools 0.6
SQLite 3.7.3
Subversion 1.7.7 r1393599
jQuery 1.7.2

Enabled Plugins


Python Traceback

Traceback  most recent call last :  
File  /usr/local/lib/python2.6/dist-packages/Trac-1.0.1dev_r0-py2.6.egg/trac/versioncontrol/web_ui/changeset.py , line 427, in _render_html
  revprops   chgset.get_properties    
File  /usr/local/lib/python2.6/dist-packages/TracMercurial- , line 1223, in get_properties
  bookmarks   self.ctx.bookmarks   AttributeError:  changectx  object has no attribute  bookmarks  

Attachments (0)

Change History (6)

comment:1 by Christian Boos, 12 years ago

Description: modified (diff)

Fixing the "newline character is missing from my charset" issue in the description…

comment:2 by Christian Boos, 12 years ago

Milestone: plugin - mercurial
Owner: set to Christian Boos
Status: newassigned

Well, Mercurial 1.6.4 is a bit too old for the newest version of the plugin. I see that we still have compatible with ≥ 1.1.x written in TracMercurial however.

We can add a check in the code for the presence of the bookmarks method, but I wonder if you're not going to run into other issues…

Last edited 12 years ago by Christian Boos (previous) (diff)

comment:3 by Christian Boos, 12 years ago

The following quick hack works…

  • tracext/hg/backend.py

    diff -r 62e59cafa3de tracext/hg/backend.py
    a b  
    12141214        tags = self.get_tags()
    12151215        if len(tags):
    12161216            properties['hg-Tags'] = (self.repos, tags)
    1217         bookmarks = self.ctx.bookmarks()
     1217        bookmarks = self.ctx.bookmarks() if hasattr(self.ctx, 'bookmarks') \
     1218            else ()
    12181219        if len(bookmarks):
    12191220            properties['hg-Bookmarks'] = (self.repos, bookmarks)
    12201221        for k, v in self.ctx.extra().iteritems():

Maybe someone has a better idea for checking for bookmark support, if not I'll commit something like that.

comment:4 by Christian Boos, 12 years ago

Resolution: fixed
Status: assignedclosed

(Another) quick hack committed as [8df754d9b36a/mercurial-plugin].

comment:5 by Christian Boos, 12 years ago

PS: don't hesitate to open other tickets if you find other problems with Mercurial 1.6.4, as it's been a while I haven't test the older versions.

comment:6 by r.rossmair, 12 years ago

Thank you, that did it.

Mercurial 1.6.4 is the package version in Debian squeeze. I'm thinking about installing the package from backports however, given that with 1.6.4 apparently problems are more likely to arise.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.