diff --git a/mercurial/templater.py b/mercurial/templater.py index 16558da417..bd1669dfbc 100644 --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -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) diff --git a/tests/test-command-template.t b/tests/test-command-template.t index d3fa3387be..cf46141125 100644 --- a/tests/test-command-template.t +++ b/tests/test-command-template.t @@ -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