changeset 32852:edde2e974ed0

cmdutil: rename gettemplate() to _lookuplogtemplate() This function is only useful when processing log options.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 22 Apr 2017 15:30:27 +0900
parents 99df35499cae
children 9d76812f9b0b
files mercurial/cmdutil.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sat Apr 22 15:11:53 2017 +0900
+++ b/mercurial/cmdutil.py	Sat Apr 22 15:30:27 2017 +0900
@@ -1646,7 +1646,7 @@
                 self.footer = templater.stringify(
                     self.t(self._parts['footer'], **props))
 
-def gettemplate(ui, tmpl, style):
+def _lookuplogtemplate(ui, tmpl, style):
     """
     Find the template matching the given template spec or style.
     """
@@ -1692,7 +1692,8 @@
     if opts.get('template') == 'json':
         return jsonchangeset(ui, repo, matchfn, opts, buffered)
 
-    tmpl, mapfile = gettemplate(ui, opts.get('template'), opts.get('style'))
+    spec = _lookuplogtemplate(ui, opts.get('template'), opts.get('style'))
+    tmpl, mapfile = spec
 
     if not tmpl and not mapfile:
         return changeset_printer(ui, repo, matchfn, opts, buffered)
@@ -2944,7 +2945,7 @@
 
 def buildcommittemplate(repo, ctx, subs, extramsg, tmpl):
     ui = repo.ui
-    tmpl, mapfile = gettemplate(ui, tmpl, None)
+    tmpl, mapfile = _lookuplogtemplate(ui, tmpl, None)
 
     t = changeset_templater(ui, repo, None, {}, tmpl, mapfile, False)