mercurial/templater.py
changeset 29848 b1f69dbdd76b
parent 29818 407879b0893b
child 30008 e83f89d3b1f7
--- a/mercurial/templater.py	Tue Aug 23 16:40:08 2016 -0400
+++ b/mercurial/templater.py	Wed Aug 24 17:43:45 2016 -0700
@@ -1047,6 +1047,19 @@
         elif key == "__base__":
             # treat as a pointer to a base class for this style
             path = util.normpath(os.path.join(base, val))
+
+            # fallback check in template paths
+            if not os.path.exists(path):
+                for p in templatepaths():
+                    p2 = util.normpath(os.path.join(p, val))
+                    if os.path.isfile(p2):
+                        path = p2
+                        break
+                    p3 = util.normpath(os.path.join(p2, "map"))
+                    if os.path.isfile(p3):
+                        path = p3
+                        break
+
             bcache, btmap = _readmapfile(path)
             for k in bcache:
                 if k not in cache: