Oh ! Yes !
I did it . I forgot to mention that I installed Hg connector using 1.3
and I experienced the same (and a few more ;o) problems. It needs some
minor changes since it seems that some refactorings have been
performed in Mercurial and things are not where they used to be.
Thanks God Hg is implemented in Py !
Please apply the following patch to backend.py (i.e. TracMercurial
r7744 for Trac 0.11)
{{{
--- /media/A-Denys14GB/soft/Tools/PM/trac/tracX/hg/backend.py
2008-12-03 17:43:40.000000000 -0500
+++ /media/A-Denys14GB/soft/Tools/PM/trac/tracX/hg/backend_fixed.py
2009-07-08 06:39:09.000000000 -0500
@@ -47,7 +47,7 @@
from mercurial import hg
from mercurial.hg import repository
from mercurial.ui import ui
- from mercurial.repo import RepoError
+ from mercurial.error import RepoError
from mercurial.revlog import LookupError
from mercurial.node import hex, short, nullid
from mercurial.util import pathto, cachefunc
@@ -204,8 +204,8 @@
def get_repository(self, type, dir, authname):
"""Return a `MercurialRepository`"""
if not self._version:
- from mercurial.version import get_version
- self._version = get_version()
+ from mercurial.__version__ import version
+ self._version = version
self.env.systeminfo.append(('Mercurial', self._version))
if not self.ui:
self._setup_ui(self.config.get(type, 'hgrc'))
@@ -251,7 +251,7 @@
class trac_ui(ui):
def __init__(self, log, *args, **kwargs):
kwargs = kwargs.copy()
- kwargs['interactive'] = False
+ # kwargs['interactive'] = False
ui.__init__(self, *args, **kwargs)
self.log = log
}}}
PS: If anybody has the time, please, submit a patch to Trac's site .
Other people might need it too ;o)
--
Regards,
Olemis.
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Featured article:
Well as you can see in my previous that patch doesnt work for me since
there are a few more things that need to be changed in `backend.py`.
Thnx anyway for the pointer ;o).
Well the patch you mention is for rev 8352 and the stable dist is at 7744:
I saw the code in there and a better patch (for 7744 ;o) would be :
{{{
--- /media/A-Denys14GB/soft/Tools/PM/trac/tracX/hg/backend.py 2008-12-03
17:43:40.000000000 -0500
+++ /media/A-Denys14GB/soft/Tools/PM/trac/tracX/hg/backend_fixed.py 2009-07-13
14:42:25.000000000 -0500
@@ -47,8 +47,12 @@
from mercurial import hg
from mercurial.hg import repository
from mercurial.ui import ui
+
from mercurial.repo import RepoError
from mercurial.revlog import LookupError
+ if repr(RepoError) == "<unloaded module 'RepoError'>":
+ from mercurial.error import RepoError, LookupError
+
from mercurial.node import hex, short, nullid
from mercurial.util import pathto, cachefunc
from mercurial.cmdutil import walkchangerevs
@@ -204,7 +208,10 @@
def get_repository(self, type, dir, authname):
"""Return a `MercurialRepository`"""
if not self._version:
- from mercurial.version import get_version
+ try:
+ from mercurial.version import get_version
+ except ImportError: # gone in Mercurial 1.2 (hg:9626819b2e3d)
+ from mercurial.util import version as get_version
self._version = get_version()
self.env.systeminfo.append(('Mercurial', self._version))
if not self.ui:
@@ -251,7 +258,7 @@
class trac_ui(ui):
def __init__(self, log, *args, **kwargs):
kwargs = kwargs.copy()
- kwargs['interactive'] = False
+ # kwargs['interactive'] = False
ui.__init__(self, *args, **kwargs)
self.log = log
}}}
It should work with multiple versions of Mercurial ;o)