Modify

Opened 8 years ago

Closed 8 years ago

#13132 closed defect (fixed)

citecode macro not playing nice with other repo links

Reported by: christiano@… Owned by: Ryan J Ollos
Priority: normal Component: CiteCodeMacro
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

I believe that the macro breaks when other repository link(s) come after the macro. It appears to work normally when the other repo links are before the macro on the wiki page.

This seems to work fine:

[[source:HG_REPO_NAME/path/file|Link Name]]
[[CiteCode(HG_REPO_NAME/path/file?rev=1#L11-39)]]

But this:

[[CiteCode(HG_REPO_NAME/path/file?rev=1#L11-39)]]
[[source:HG_REPO_NAME/path/file|Link Name]]

Causes the following error "Trac detected an internal error: TypeError: object of type 'NoneType' has no len()"

File "/usr/lib/python2.7/dist-packages/trac/wiki/templates/wiki_edit.html", line 161, in <Expression u'wiki_to_html(context.child(page.resource), page.text)'>
File "/usr/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 1546, in format_to_html
File "/usr/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 1501, in generate
File "/usr/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 1283, in format
File "/usr/lib/python2.7/re.py", line 151, in sub
File "/usr/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 1201, in replace
File "/usr/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 1197, in handle_match
File "/usr/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 754, in _macrolink_formatter
File "/usr/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 591, in _lhref_formatter
File "/usr/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 626, in _make_lhref_link
File "/usr/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 637, in _make_link
File "/usr/lib/python2.7/dist-packages/trac/versioncontrol/web_ui/browser.py", line 798, in _format_browser_link
File "/usr/lib/python2.7/dist-packages/trac/versioncontrol/web_ui/browser.py", line 819, in _get_link_info
File "/usr/lib/python2.7/dist-packages/trac/versioncontrol/web_ui/util.py", line 86, in get_allowed_node
File "build/bdist.linux-x86_64/egg/tracext/hg/backend.py", line 775, in get_node
File "build/bdist.linux-x86_64/egg/tracext/hg/backend.py", line 606, in changectx
File "build/bdist.linux-x86_64/egg/tracext/hg/backend.py", line 632, in short_rev

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by christiano@…

I should mention that I am currently working with TracCiteCode 0.3.0

comment:2 Changed 8 years ago by Ryan J Ollos

Owner: changed from tkob-trac to Ryan J Ollos
Status: newaccepted

Confirmed. The issue is caused by calling repos.close().

comment:3 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 16421:

TracCiteCode 0.3.4: Don't close repository in macro

Fixes #13132.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.