Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

#9397 closed defect (fixed)

Mercurial plugin load fails with KeyError

Reported by: obaudys@… Owned by:
Priority: high Milestone: plugin - mercurial
Component: plugin/mercurial Version: 0.12b1
Severity: trivial Keywords: mercurial repository plugin keyerror multiple repo multi
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

After installing the mercurial plugin 0.12 from svn (r9771), with trac 0.12b, I get the following error in <trac-env>/logs/trac.log:

2010-06-03 17:49:22,042 Trac[env] INFO: -------------------------------- environment startup [Trac 0.12b1] -----------------------------
---
2010-06-03 17:49:22,078 Trac[loader] DEBUG: Adding plugin TracMercurial 0.12.0.21dev-r9771 from /home/ondrej/work/tracenv/plugins/TracMercurial-0.12.0.21dev_r9771-py2.6.egg
2010-06-03 17:49:22,092 Trac[loader] DEBUG: Loading hg from /home/ondrej/work/tracenv/plugins/TracMercurial-0.12.0.21dev_r9
771-py2.6.egg
2010-06-03 17:49:22,108 Trac[loader] ERROR: Skipping "hg = tracext.hg.backend": 
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/loader.py", line 70, in _load_eggs
    entry.load(require=True)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1913, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "build/bdist.linux-x86_64/egg/tracext/hg/backend.py", line 38, in <module>
  File "build/bdist.linux-x86_64/egg/trac/util/translation.py", line 88, in domain_functions
    return [_functions[s] for s in symbols]
KeyError: ('gettext', '_', 'tag_', 'N_', 'add_domain'))

Needless to say, when I navigate to "Admin -> Repositories" and try to add a mercurial repository, the "hg" repository type option is not there.

If I add it manually to config/trac.ini, like so:

[trac]
# ...
repository_dir = /home/ondrej/tmp/hg/proper/default
repository_type = hg

then I get the following:

'Warning: Can't synchronize with repository "(default)" (Unsupported version control system "hg": Can't find an appropriate component, maybe the corresponding plugin was not enabled? ). Look in the Trac log for more information.'

at the top of the page when I navigate to Admin -> Repositories

Attachments (0)

Change History (3)

comment:1 by Ondrej Baudys <obaudys@…>, 14 years ago

Milestone: 0.12plugin - mercurial

comment:2 by Ondrej Baudys <obaudys@…>, 14 years ago

Well, seeing as the error occurred in trac/util/translation.py, on a whim I installed Babel 0.9.5 via "easy_install". The error I get now changes to:

2010-06-03 18:17:29,265 Trac[env] INFO: -------------------------------- environment startup [Trac 0.12b1] --------------------------------
2010-06-03 18:17:29,296 Trac[loader] DEBUG: Adding plugin TracMercurial 0.12.0.21dev-r9771 from /home/ondrej/work/tracenv/plugins/TracMercurial-0.12.0.21dev_r9771-py2.6.egg
2010-06-03 18:17:29,311 Trac[loader] DEBUG: Loading hg from /home/ondrej/work/tracenv/plugins/TracMercurial-0.12.0.21dev_r9771-py2.6.egg
2010-06-03 18:17:29,326 Trac[loader] ERROR: Skipping "hg = tracext.hg.backend": 
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/loader.py", line 70, in _load_eggs
    entry.load(require=True)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1913, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "build/bdist.linux-x86_64/egg/tracext/hg/backend.py", line 38, in <module>
ValueError: need more than 1 value to unpack)

Obviously there is some coupling there with Babel, which is optional, is it not? So that in itself is a bug which produced the KeyError.

comment:3 by Christian Boos, 14 years ago

Resolution: fixed
Severity: blockertrivial
Status: newclosed

Sorry, r9770 broke compatibility with Trac 0.12b1, you should either get an older version of the plugin, or wait till this evening for 0.12rc1.

I clarified the situation with a new version number (r9811) and an update of the TracMercurial#Releases table.

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.