Edgewall Software

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#9477 closed defect (fixed)

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

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
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: 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 	/usr/local/lib/python2.6/dist-packages/TracMercurial-

Attachments (0)

Change History (5)

comment:1 by Remy Blank, 11 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.

comment:2 by anonymous, 11 years ago

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

in reply to:  2 comment:3 by Remy Blank, 11 years ago

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 by Remy Blank, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in [9936]. Update your installation!

comment:5 by sphe@…, 11 years ago

You sir are awesome. Thanks.

Modify Ticket

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