diff -r dd5eca480af6 -r f65280d03582 hgkw/keyword.py --- a/hgkw/keyword.py Fri Jun 06 17:21:00 2008 +0200 +++ b/hgkw/keyword.py Thu Jun 12 16:32:16 2008 +0200 @@ -94,7 +94,7 @@ commands.optionalrepo += ' kwdemo' # hg commands that do not act on keywords -nokwcommands = ('add addremove bundle copy export grep incoming init' +nokwcommands = ('add addremove annotate bundle copy export grep incoming init' ' log outgoing push rename rollback tip' ' convert email glog') @@ -703,6 +703,11 @@ try: from mercurial.hgweb import webcommands + def kwweb_annotate(web, req, tmpl): + '''Wraps webcommands.annotate turning off keyword expansion.''' + kwt.matcher = util.never + return webcommands_annotate(web, req, tmpl) + def kwweb_changeset(web, req, tmpl): '''Wraps webcommands.changeset turning off keyword expansion.''' kwt.matcher = util.never @@ -713,13 +718,20 @@ kwt.matcher = util.never return webcommands_filediff(web, req, tmpl) + webcommands_annotate = webcommands.annotate webcommands_changeset = webcommands.changeset webcommands_filediff = webcommands.filediff + + webcommands.annotate = kwweb_annotate webcommands.changeset = webcommands.rev = kwweb_changeset webcommands.filediff = webcommands.diff = kwweb_filediff except ImportError: from mercurial.hgweb.hgweb_mod import hgweb + def kwweb_do_annotate(self, req): + kwt.matcher = util.never + hgweb_do_annotate(self, req) + def kwweb_do_changeset(self, req): kwt.matcher = util.never hgweb_do_changeset(self, req) @@ -728,8 +740,11 @@ kwt.matcher = util.never hgweb_do_filediff(self, req) + hgweb_do_annotate = hgweb.do_annotate hgweb_do_changeset = hgweb.do_changeset hgweb_do_filediff = hgweb.do_filediff + + hgweb.do_annotate = kwweb_do_annotate hgweb.do_changeset = hgweb.do_rev = kwweb_do_changeset hgweb.do_filediff = hgweb.do_diff = kwweb_do_filediff