keyword: make the templater a local variable
authorChristian Ebert <blacktrash@gmx.net>
Mon, 12 Apr 2010 17:34:12 +0200
changeset 10894 26cf11f9f322
parent 10893 468876bc3885
child 10895 217557b26bc7
keyword: make the templater a local variable After 6722ba3bf80b a class attribute makes no sense.
hgext/keyword.py
--- a/hgext/keyword.py	Mon Apr 12 17:21:30 2010 -0700
+++ b/hgext/keyword.py	Mon Apr 12 17:34:12 2010 +0200
@@ -140,11 +140,11 @@
         '''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])
+            ct = cmdutil.changeset_templater(self.ui, self.repo,
+                                             False, None, '', False)
+            ct.use_template(self.templates[kw])
             self.ui.pushbuffer()
-            self.ct.show(ctx, root=self.repo.root, file=path)
+            ct.show(ctx, root=self.repo.root, file=path)
             ekw = templatefilters.firstline(self.ui.popbuffer())
             return '$%s: %s $' % (kw, ekw)
         return subfunc(kwsub, data)