mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
templater: handle a missing value correctly
Before, using a broken style such as: changeset = would result in a traceback. This fixes a regression introduced in 47618355ffc8.
This commit is contained in:
parent
7f1365342e
commit
48a670fcaf
@ -295,6 +295,8 @@ class templater(object):
|
||||
conf.read(mapfile)
|
||||
|
||||
for key, val in conf[''].items():
|
||||
if not val:
|
||||
raise SyntaxError(_('%s: missing value') % conf.source('', key))
|
||||
if val[0] in "'\"":
|
||||
try:
|
||||
self.cache[key] = parsestring(val)
|
||||
|
@ -463,6 +463,13 @@ Error if style missing key:
|
||||
abort: "changeset" not in template map
|
||||
[255]
|
||||
|
||||
Error if style missing value:
|
||||
|
||||
$ echo 'changeset =' > t
|
||||
$ hg log --style t
|
||||
abort: t:1: missing value
|
||||
[255]
|
||||
|
||||
Error if include fails:
|
||||
|
||||
$ echo 'changeset = q' >> t
|
||||
|
Loading…
Reference in New Issue
Block a user