changeset 32842:97a4d09f5140

changeset_templater: render template specified by templatespec tuple
author Yuya Nishihara <yuya@tcha.org>
date Tue, 11 Apr 2017 21:38:24 +0900
parents 883adaea9e80
children a470bbb4e3af
files mercurial/cmdutil.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sat Apr 22 19:29:41 2017 +0900
+++ b/mercurial/cmdutil.py	Tue Apr 11 21:38:24 2017 +0900
@@ -1593,7 +1593,9 @@
             (self.ui.debugflag, 'debug'),
         ]
 
-        self._parts = {'header': '', 'footer': '', 'changeset': 'changeset',
+        self._tref = tmplspec.ref
+        self._parts = {'header': '', 'footer': '',
+                       tmplspec.ref: tmplspec.ref,
                        'docheader': '', 'docfooter': ''}
         for mode, postfix in tmplmodes:
             for t in self._parts:
@@ -1637,7 +1639,7 @@
                     self.ui.write(h)
 
         # write changeset metadata, then patch if requested
-        key = self._parts['changeset']
+        key = self._parts[self._tref]
         self.ui.write(templater.stringify(self.t(key, **props)))
         self.showpatch(ctx, matchfn)