Edgewall Software
Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#9477 closed defect (fixed)

CommitTicketReferenceMacro is broken, causes AttributeError: 'NoneType' object has no attribute 'resource'

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

Description (last modified by rblank)

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

Attachments (0)

Change History (5)

comment:1 Changed 4 years ago by rblank

  • Component changed from general to version control
  • Description modified (diff)
  • Owner set to rblank
  • Version set to 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.

comment:2 follow-up: Changed 4 years ago by anonymous

Thanks for quick response. Renaming is possible. The trac.ini does reflect the correct repo name. Is there a work around?

comment:3 in reply to: ↑ 2 Changed 4 years ago by rblank

Replying to anonymous:

Renaming is possible. The trac.ini does reflect the correct repo name.

The question was: did you rename the repository after the commit was done (and the comment added to the ticket)?

Is there a work around?

I have a fix, I just need to test it a bit and I'll commit it in a few minutes.

comment:4 Changed 4 years ago by rblank

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [9936]. Update your installation!

comment:5 Changed 4 years ago by sphe@…

You sir are awesome. Thanks.

Modify Ticket

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