mercurial/templater.py
changeset 37067 04aafcec00b9
parent 37019 c97b936d8bb5
child 37070 1101d6747d2d
--- a/mercurial/templater.py	Sun Mar 18 12:28:19 2018 +0900
+++ b/mercurial/templater.py	Fri Mar 16 22:36:40 2018 +0900
@@ -627,6 +627,14 @@
                 raise
         return self._cache[t]
 
+    def preload(self, t):
+        """Load, parse, and cache the specified template if available"""
+        try:
+            self._load(t)
+            return True
+        except templateutil.TemplateNotFound:
+            return False
+
     def process(self, t, mapping):
         '''Perform expansion. t is name of map element to expand.
         mapping contains added elements for use during expansion. Is a