# HG changeset patch # User Christian Ebert # Date 1206889982 -7200 # Node ID d830cdde0ddb0edad0d542a7c126cf494e8ecbc9 # Parent 140fe33eacf36bc97ea7f018e8206faedb39fe65 (0.9.2compat) fix webcommand monkey patches, and adapt to most recent changes diff -r 140fe33eacf3 -r d830cdde0ddb hgkw/keyword.py --- 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