# HG changeset patch # User Christian Ebert # Date 1213281136 -7200 # Node ID f65280d035823d9a9eedb233c5af612f2d6e79d6 # Parent dd5eca480af6f2cf168094f0414d3ce9edf7711b (0.9.2compat) disable expansion for annotate 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 diff -r dd5eca480af6 -r f65280d03582 tests/test-keyword --- a/tests/test-keyword Fri Jun 06 17:21:00 2008 +0200 +++ b/tests/test-keyword Thu Jun 12 16:32:16 2008 +0200 @@ -196,7 +196,10 @@ echo % cat cat a b echo % hg cat -hg cat a b +hg cat sym a b +echo +echo % annotate +hg annotate a echo % remove hg debugrebuildstate diff -r dd5eca480af6 -r f65280d03582 tests/test-keyword.out --- a/tests/test-keyword.out Fri Jun 06 17:21:00 2008 +0200 +++ b/tests/test-keyword.out Thu Jun 12 16:32:16 2008 +0200 @@ -238,6 +238,12 @@ xxx $ $Xinfo: User Name : firstline $ ignore $Id$ +a +% annotate +1: expand $Id$ +1: do not process $Id: +1: xxx $ +2: $Xinfo$ % remove % status % rollback