hgweb: refactor hgweb code stable
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Fri, 28 Mar 2008 19:40:44 +0100
branchstable
changeset 431 4fb8a2e526ff
parent 429 688d71563c07
child 437 7219104a7cfc
child 445 0c91995647e9
hgweb: refactor hgweb code [ original upstream description ]
hgkw/keyword.py
--- a/hgkw/keyword.py	Sat Mar 22 18:33:10 2008 +0100
+++ b/hgkw/keyword.py	Fri Mar 28 19:40:44 2008 +0100
@@ -130,15 +130,21 @@
     _patch_diff(repo, node1=node1, node2=node2, files=files, match=match,
                 fp=fp, changes=changes, opts=opts)
 
+# monkeypatching hgweb functions changeset and filediff
+# actual monkeypatching is done at the bottom of reposetup()
+
+web_changeset = webcommands.changeset
+web_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))
+    return web_changeset(web, req, tmpl)
 
 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))
+    return web_filediff(web, req, tmpl)
 
 def _kwdispatch_parse(ui, args):
     '''Monkeypatch dispatch._parse to obtain running hg command.'''