Patchwork [7,of,8] cmdutil: rename gettemplate() to _lookuplogtemplate()

login
register
mail settings
Submitter Yuya Nishihara
Date June 14, 2017, 1:40 p.m.
Message ID <1eebb6b06eb09504ee66.1497447638@mimosa>
Download mbox | patch
Permalink /patch/21377/
State Accepted
Headers show

Comments

Yuya Nishihara - June 14, 2017, 1:40 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1492842627 -32400
#      Sat Apr 22 15:30:27 2017 +0900
# Node ID 1eebb6b06eb09504ee66daa8f02f3e6caa459b54
# Parent  9cbdd6d4990b16046aaf861a7ef7ecafe559e99e
cmdutil: rename gettemplate() to _lookuplogtemplate()

This function is only useful when processing log options.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1646,7 +1646,7 @@  class changeset_templater(changeset_prin
                 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 @@  def show_changeset(ui, repo, opts, buffe
     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 commitforceeditor(repo, ctx, subs, f
 
 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)