Edgewall Software

Opened 2 years ago

Closed 2 years ago

#13036 closed defect (fixed)

AttributeError: 'tuple' object has no attribute 'rev'

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: plugin - mercurial
Component: plugin/mercurial Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fix compatibility of blame view with newer Mercurial versions.

API Changes:
Internal Changes:


Seen in the logs, may just be an invalid request, but it would be good to avoid the traceback.

[pid 3126 140365895681792] 2018-06-01 04:30:21,795 Trac[main] ERROR: [] Internal Server Error: <RequestWithSession "GET '/browser/mirror/trac/env.py?annotate=blame&rev=fa8c151057237b911701496b1cbaf8d58b12767e'">, referrer None
Traceback (most recent call last):
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/web/main.py", line 664, in _dispatch_request
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/web/main.py", line 249, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/versioncontrol/web_ui/browser.py", line 405, in process_request
    file_data = self._render_file(req, context, repos, node, rev)
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/versioncontrol/web_ui/browser.py", line 732, in _render_file
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/mimeview/api.py", line 1006, in preview_data
    annotations, force_source=force_source)
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/mimeview/api.py", line 821, in render
    return self._render_source(context, result, annotations)
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/mimeview/api.py", line 847, in _render_source
    data = (annotator, annotator.get_annotation_data(context))
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/versioncontrol/web_ui/browser.py", line 874, in get_annotation_data
    return BlameAnnotator(self.env, context)
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/versioncontrol/web_ui/browser.py", line 978, in __init__
  File "/usr/local/virtualenv/1.3dev/lib/python2.7/site-packages/trac/versioncontrol/web_ui/browser.py", line 985, in reset
    self.annotations = node.get_annotations()
  File "build/bdist.linux-x86_64/egg/tracext/hg/backend.py", line 1226, in get_annotations
    annotations.append(fc.rev() or '0')
AttributeError: 'tuple' object has no attribute 'rev'

Attachments (0)

Change History (3)

comment:1 by Jun Omae, 2 years ago

The return value of context.annotate() has been changes in the following versions:

3.8.4 returns a list of tuples of (ctx, line) for each line in the file
3.9.2 returns a list of tuples of ((ctx, number), line) for each line in the file
4.5.3 returns a list of tuples of ((ctx, number), line) for each line in the file
4.6 Returns a list of annotateline objects for each line in the file

comment:2 by Jun Omae, 2 years ago

#13047 was closed as duplicate.

comment:3 by Peter Suter, 2 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: newclosed

Pushed patch from #13047 with test in [56/mercurial-plugin].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) 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.