cmdutil: rename gettemplate() to _lookuplogtemplate()
This function is only useful when processing log options.
--- 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)