cmdutil: rename gettemplate() to _lookuplogtemplate()
authorYuya Nishihara <yuya@tcha.org>
Sat, 22 Apr 2017 15:30:27 +0900
changeset 32834 edde2e974ed0
parent 32833 99df35499cae
child 32835 9d76812f9b0b
cmdutil: rename gettemplate() to _lookuplogtemplate() This function is only useful when processing log options.
mercurial/cmdutil.py
--- 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)