[PATCH] keyword: make the templater a local variable

Christian Ebert blacktrash at gmx.net
Mon Apr 12 10:35:08 CDT 2010


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1271086452 -7200
# Node ID c44ec786dd7db2b0d71aaf5a66a619159c9803e7
# Parent  4fb1bafd43e7e829dec0886aff8b10f643c54470
keyword: make the templater a local variable

After 6722ba3bf80b a class attribute makes no sense.

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -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)


More information about the Mercurial-devel mailing list