##// END OF EJS Templates
templater: add template path to __base__ search...
Matt Mackall -
r29848:b1f69dbd default
parent child Browse files
Show More
@@ -1047,6 +1047,19 def _readmapfile(mapfile):
1047 1047 elif key == "__base__":
1048 1048 # treat as a pointer to a base class for this style
1049 1049 path = util.normpath(os.path.join(base, val))
1050
1051 # fallback check in template paths
1052 if not os.path.exists(path):
1053 for p in templatepaths():
1054 p2 = util.normpath(os.path.join(p, val))
1055 if os.path.isfile(p2):
1056 path = p2
1057 break
1058 p3 = util.normpath(os.path.join(p2, "map"))
1059 if os.path.isfile(p3):
1060 path = p3
1061 break
1062
1050 1063 bcache, btmap = _readmapfile(path)
1051 1064 for k in bcache:
1052 1065 if k not in cache:
@@ -103,6 +103,18 Test templates and style maps in files:
103 103 $ hg log -l1 -T./map-simple
104 104 8
105 105
106 Test template map inheritance
107
108 $ echo "__base__ = map-cmdline.default" > map-simple
109 $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
110 $ hg log -l1 -T./map-simple
111 changeset: ***8***
112 tag: tip
113 user: test
114 date: Wed Jan 01 10:01:00 2020 +0000
115 summary: third
116
117
106 118 Template should precede style option
107 119
108 120 $ hg log -l1 --style default -T '{rev}\n'
General Comments 0
You need to be logged in to leave comments. Login now