Edgewall Software

Opened 14 years ago

Last modified 14 years ago

#9477 closed defect

CommitTicketReferenceMacro is broken, causes AttributeError: 'NoneType' object has no attribute 'resource' — at Version 1

Reported by: anonymous Owned by: Remy Blank
Priority: high Milestone: 0.12.1
Component: version control Version: 0.12dev
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Remy Blank)

When enabled causes:

AttributeError: 'NoneType' object has no attribute 'resource'

File "/var/www/trac/egg-cache/Trac-0.12.1dev_r9930-py2.6.egg-tmp/trac/ticket/templates/ticket_change.html", line 61, in <Expression u'wiki_to_html(context, change.comment, escape_newlines=preserve_newlines)'>
  <py:otherwise>${wiki_to_html(context, change.comment, escape_newlines=preserve_newlines)}</py:otherwise>
File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 1497, in format_to_html
  return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 1452, in generate
  escape_newlines)
File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 1194, in format
  self.handle_code_block(line, block_start_match)
File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 1084, in handle_code_block
  processed = self.code_processor.process(code_text)
File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 304, in process
  text = self.processor(text)
File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 288, in _macro_processor
  text, self.args)
File "build/bdist.linux-x86_64/egg/tracopt/ticket/commit_updater.py", line 290, in expand_macro
  formatter.context('changeset', rev, parent=repos.resource),

System Information:

User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6
Trac 	0.12.1dev-r9930
Genshi 	0.7dev-r1134
Mercurial 	1.1.2
psycopg2 	2.0.8
Pygments 	0.10
Python 	2.6.2 (release26-maint, Apr 19 2009, 02:15:38) [GCC 4.3.3]
pytz 	2008h
setuptools 	0.7a1
Subversion 	1.5.4 (r33841)
jQuery	1.2.6
Enabled Plugins:
IniAdmin 	0.2 	/usr/local/lib/python2.6/dist-packages/IniAdmin-0.2-py2.6.egg
TracMercurial 	0.12.0.22dev-r9826 	/usr/local/lib/python2.6/dist-packages/TracMercurial-0.12.0.22dev_r9826-py2.6.egg

Change History (1)

comment:1 by Remy Blank, 14 years ago

Component: generalversion control
Description: modified (diff)
Owner: set to Remy Blank
Version: 0.12dev

This happens if the repository referenced in the macro call doesn't exist. Did you happen to rename the repository?

The macro should be more robust against this.

Note: See TracTickets for help on using tickets.