diff -r de7dc25ecf2e -r 11e667a8fcba mercurial/formatter.py --- a/mercurial/formatter.py Sat Apr 22 14:53:05 2017 +0900 +++ b/mercurial/formatter.py Sat Apr 22 15:06:06 2017 +0900 @@ -408,6 +408,12 @@ def gettemplater(ui, topic, spec, cache=None): tmpl, mapfile = lookuptemplate(ui, topic, spec) + return loadtemplater(ui, topic, (tmpl, mapfile), cache=cache) + +def loadtemplater(ui, topic, spec, cache=None): + """Create a templater from either a literal template or loading from + a map file""" + tmpl, mapfile = spec assert not (tmpl and mapfile) if mapfile: return templater.templater.frommapfile(mapfile, cache=cache)