hgkw/keyword.py
branch0.9.2compat
changeset 433 d830cdde0ddb
parent 432 140fe33eacf3
child 435 7bc92583f344
--- a/hgkw/keyword.py	Sun Mar 30 17:04:37 2008 +0200
+++ b/hgkw/keyword.py	Sun Mar 30 17:13:02 2008 +0200
@@ -167,16 +167,24 @@
 
 try:
     from mercurial.hgweb import webcommands
+    _webcommands_changeset = webcommands.changeset
+    _webcommands_filediff = webcommands.filediff
 
     def _kwweb_changeset(web, req, tmpl):
         '''Wraps webcommands.changeset turning off keyword expansion.'''
         kwtools['templater'].matcher = util.never
-        return web.changeset(tmpl, web.changectx(req))
+        try:
+            return _webcommands_changeset(web, req, tmpl)
+        except TypeError:
+            return _webcommands_changeset(tmpl, web.changectx(req))
 
     def _kwweb_filediff(web, req, tmpl):
         '''Wraps webcommands.filediff turning off keyword expansion.'''
         kwtools['templater'].matcher = util.never
-        return web.filediff(tmpl, web.filectx(req))
+        try:
+            return _webcommands_filediff(web, req, tmpl)
+        except TypeError:
+            return _webcommands_filediff(tmpl, web.filectx(req))
 
     webcommands.changeset = webcommands.rev = _kwweb_changeset
     webcommands.filediff = webcommands.diff = _kwweb_filediff