Do not bother about debug templates
Speedup of debug flag toggle dubious at best.
{files}, {file_adds} etc. templates do not make sense in file context,
but leave decision to user; that's what kwdemo is for.
--- a/hgkw/keyword.py Wed Nov 14 13:32:33 2007 +0100
+++ b/hgkw/keyword.py Mon Nov 26 12:24:16 2007 +0100
@@ -113,7 +113,6 @@
self.t = expand or None
self.path = path
self.node = node
- self.debug = self.ui.debugflag
kwmaps = self.ui.configitems('keywordmaps')
if kwmaps: # override default templates
@@ -138,16 +137,11 @@
return '$%s: %s $' % (kw, keywordsub)
def substitute(self, node, data, subfunc):
- '''Obtains node if missing.
- Ensures consistent templates regardless of ui.debugflag.
- Calls given substitution function.'''
+ '''Obtains node if missing, and calls given substitution function.'''
if not self.node:
c = context.filectx(self.repo, self.path, fileid=node)
self.node = c.node()
- self.ui.debugflag = False
- result = subfunc(self.kwsub, data)
- self.ui.debugflag = self.debug
- return result
+ return subfunc(self.kwsub, data)
def expand(self, node, data):
'''Returns data with keywords expanded.'''