mercurial/formatter.py
changeset 32832 11e667a8fcba
parent 32830 470820c2418d
child 32833 99df35499cae
--- 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)