comparison tests/test-template-map.t @ 45222:f512708a9ea8

tests: add tests trying to use dir as style, as %include, and as __base__ Differential Revision: https://phab.mercurial-scm.org/D8800
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 23 Jul 2020 22:06:36 -0700
parents be1ab47d90f1
children 46c8db8d4e03
comparison
equal deleted inserted replaced
45221:be1ab47d90f1 45222:f512708a9ea8
131 $ hg log -l1 -T./map-base-nonexistent 131 $ hg log -l1 -T./map-base-nonexistent
132 abort: style '$TESTTMP/a/non-existent' not found 132 abort: style '$TESTTMP/a/non-existent' not found
133 (available styles: bisect, changelog, compact, default, phases, show, status, xml) 133 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
134 [255] 134 [255]
135 135
136 Test map inheritance with directory as base
137
138 $ mkdir somedir
139 $ echo "__base__ = somedir" > map-base-dir
140 $ hg log -l1 -T./map-base-dir
141 abort: Is a directory: '$TESTTMP/a/somedir'
142 [255]
143
136 Test including a built-in template map 144 Test including a built-in template map
137 145
138 $ cat <<'EOF' > map-include-builtin 146 $ cat <<'EOF' > map-include-builtin
139 > %include map-cmdline.default 147 > %include map-cmdline.default
140 > [templates] 148 > [templates]
151 > %include nonexistent 159 > %include nonexistent
152 > [templates] 160 > [templates]
153 > changeset = "test\n" 161 > changeset = "test\n"
154 > EOF 162 > EOF
155 $ hg log -l1 -T./map-include-nonexistent 163 $ hg log -l1 -T./map-include-nonexistent
164 test
165
166 Test including a directory as template map
167 BROKEN: This should probably be an error just like the bad __base__ above
168
169 $ cat <<'EOF' > map-include-dir
170 > %include somedir
171 > [templates]
172 > changeset = "test\n"
173 > EOF
174 $ hg log -l1 -T./map-include-dir
156 test 175 test
157 176
158 Test docheader, docfooter and separator in template map 177 Test docheader, docfooter and separator in template map
159 178
160 $ cat <<'EOF' > map-myjson 179 $ cat <<'EOF' > map-myjson
1254 $ hg log -T list 1273 $ hg log -T list
1255 available styles: bisect, changelog, compact, default, phases, show, status, xml 1274 available styles: bisect, changelog, compact, default, phases, show, status, xml
1256 abort: specify a template 1275 abort: specify a template
1257 [255] 1276 [255]
1258 1277
1278 Error if style is a directory:
1279
1280 $ hg log --style somedir
1281 abort: Is a directory: 'somedir'
1282 [255]
1283
1259 Error if style missing key: 1284 Error if style missing key:
1260 1285
1261 $ echo 'q = q' > t 1286 $ echo 'q = q' > t
1262 $ hg log --style ./t 1287 $ hg log --style ./t
1263 abort: "changeset" not in template map 1288 abort: "changeset" not in template map