diff hgext/keyword.py @ 33620:50586a0a946f

cmdutil: factor out helper to create changeset_templater with literal template changeset_templater has lots of arguments, but most callers only need to specify a literal template 'tmpl'. "hg debugtemplate" has no diff option, which means 'opts' were effectively {}, so dropped opts.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 22 Apr 2017 18:42:03 +0900 (2017-04-22)
parents 04baab18d60a
children 69d1c3ea0d6f
line wrap: on
line diff
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -239,8 +239,8 @@
         '''Replaces keywords in data with expanded template.'''
         def kwsub(mobj):
             kw = mobj.group(1)
-            ct = cmdutil.changeset_templater(self.ui, self.repo, False, None,
-                                             self.templates[kw], '', False)
+            ct = cmdutil.makelogtemplater(self.ui, self.repo,
+                                          self.templates[kw])
             self.ui.pushbuffer()
             ct.show(ctx, root=self.repo.root, file=path)
             ekw = templatefilters.firstline(self.ui.popbuffer())