changeset 6072:e521ec1ad985

keyword: no expansion in web diffs Expansion in hgweb view of changesets and diffs is not needed and only distracting. Expansion stays enable in file and archive requests where it makes sense.
author Christian Ebert <blacktrash@gmx.net>
date Sun, 10 Feb 2008 04:24:59 +0100
parents 127c973e4499
children 89c70d496175
files hgext/keyword.py
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Sun Feb 10 01:53:19 2008 +0100
+++ b/hgext/keyword.py	Sun Feb 10 04:24:59 2008 +0100
@@ -80,6 +80,7 @@
 
 from mercurial import commands, cmdutil, context, dispatch, filelog, revlog
 from mercurial import patch, localrepo, templater, templatefilters, util
+from mercurial.hgweb import webcommands
 from mercurial.node import *
 from mercurial.i18n import _
 import re, shutil, tempfile, time
@@ -121,7 +122,23 @@
     _cmd, func, args, options, _cmdoptions = _dispatch_parse(ui, args)
     return _cmd, func, args, options, _cmdoptions
 
+def kwweb_changeset(web, req, tmpl):
+    try:
+        _kwtemplater.matcher = util.never
+    except AttributeError:
+        pass
+    return web.changeset(tmpl, web.changectx(req))
+
+def kwweb_filediff(web, req, tmpl):
+    try:
+        _kwtemplater.matcher = util.never
+    except AttributeError:
+        pass
+    return web.filediff(tmpl, web.filectx(req))
+
 dispatch._parse = _kwdispatch_parse
+webcommands.changeset = webcommands.rev = kwweb_changeset
+webcommands.filediff = webcommands.diff = kwweb_filediff
 
 
 class kwtemplater(object):