hgkw/keyword.py
changeset 233 e60fdc1990e3
parent 232 030712a46eb9
child 234 6f1ed470541c
--- a/hgkw/keyword.py	Thu Aug 30 23:22:18 2007 +0200
+++ b/hgkw/keyword.py	Sun Sep 02 15:01:51 2007 +0200
@@ -175,16 +175,19 @@
         escaped = [re.escape(k) for k in self.templates.keys()]
         rawkeyword = r'\$(%s)(: [^$\n\r]*? )??\$'
         self.re_kw = re.compile(rawkeyword % '|'.join(escaped))
-
         if self.t:
             templater.common_filters['utcdate'] = utcdate
-            try:
-                self.t = cmdutil.changeset_templater(self.ui, self.repo,
-                                                     False, '', False)
-            except TypeError:
-                # depending on hg rev changeset_templater has extra "brinfo" arg
-                self.t = cmdutil.changeset_templater(self.ui, self.repo,
-                                                     False, None, '', False)
+            self.t = self._changeset_templater()
+
+    def _changeset_templater(self):
+        '''Backwards compatible cmdutil.changeset_templater.'''
+        try:
+            return cmdutil.changeset_templater(self.ui, self.repo,
+                                               False, '', False)
+        except TypeError:
+            # depending on hg rev changeset_templater has extra "brinfo" arg
+            return cmdutil.changeset_templater(self.ui, self.repo,
+                                               False, None, '', False)
 
     def _ctxnode(self, node):
         '''Obtains missing node from file context.'''