changeset 10844:6722ba3bf80b

keywords: build a new templater to work around caching interaction
author Matt Mackall <mpm@selenic.com>
date Mon, 05 Apr 2010 15:25:08 -0500
parents b91c1804008e
children 9d8194c2fcbd
files hgext/keyword.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Mon Apr 05 14:33:41 2010 -0500
+++ b/hgext/keyword.py	Mon Apr 05 15:25:08 2010 -0500
@@ -135,13 +135,13 @@
         self.re_kw = re.compile(kwpat)
 
         templatefilters.filters['utcdate'] = utcdate
-        self.ct = cmdutil.changeset_templater(self.ui, self.repo,
-                                              False, None, '', False)
 
     def substitute(self, data, path, ctx, subfunc):
         '''Replaces keywords in data with expanded template.'''
         def kwsub(mobj):
             kw = mobj.group(1)
+            self.ct = cmdutil.changeset_templater(self.ui, self.repo,
+                                                  False, None, '', False)
             self.ct.use_template(self.templates[kw])
             self.ui.pushbuffer()
             self.ct.show(ctx, root=self.repo.root, file=path)