# HG changeset patch # User Yuya Nishihara # Date 1492842627 -32400 # Node ID edde2e974ed0b0ca1e20bc1235cc468440b93bae # Parent 99df35499caedb681aa2fa82adff926e2a654c09 cmdutil: rename gettemplate() to _lookuplogtemplate() This function is only useful when processing log options. diff -r 99df35499cae -r edde2e974ed0 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)