Edgewall Software

Opened 13 years ago

Last modified 12 years ago

#10247 closed defect

TracMercurial dies with Mercurial 1.9 — at Initial Version

Reported by: djc <dirkjan@…> Owned by:
Priority: high Milestone: plugin - mercurial
Component: plugin/mercurial Version:
Severity: major Keywords: apichanges
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

TracMercurial with Mercurial 1.9 dies here (using http://svn.edgewall.com/repos/trac/plugins/0.12/mercurial-plugin@10734):

File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 511, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 237, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/lib64/python2.7/site-packages/trac/versioncontrol/web_ui/changeset.py", line 295, in process_request
  prev = repos.get_node(new_path, new).get_previous()
File "/usr/lib64/python2.7/site-packages/trac/versioncontrol/api.py", line 999, in get_previous
  for p in self.get_history(2):
File "/usr/lib64/python2.7/site-packages/TracMercurial-0.12.0.28dev_r10731-py2.7.egg/tracext/hg/backend.py", line 1047, in _get_history_1_4
  matcher = match(repo, pats, opts)
File "/usr/lib64/python2.7/site-packages/mercurial/scmutil.py", line 569, in match
  m = ctx.match(pats, opts.get('include'), opts.get('exclude'),
AttributeError: 'mqrepo' object has no attribute 'match'

This should help:

Index: tracext/hg/backend.py
===================================================================
--- tracext/hg/backend.py       (revision 10734)
+++ tracext/hg/backend.py       (working copy)
@@ -97,6 +97,7 @@

     try:
         match = cmdutil.match
+        match = lambda c, p, o: match(c._repo, p, o)
     except AttributeError:
         from mercurial.scmutil import match

@@ -1044,7 +1045,7 @@
             return self._get_history_1_3(repo, pats, opts, limit)

     def _get_history_1_4(self, repo, pats, opts, limit):
-        matcher = match(repo, pats, opts)
+        matcher = match(repo[None], pats, opts)
         if self.isfile:
             fncache = {}
             def prep(ctx, fns):

Bit of a hack; seems to work, though.

Change History (0)

Note: See TracTickets for help on using tickets.