Mercurial > public > mercurial-scm > hg
comparison mercurial/templater.py @ 17334:39c01f8e7b39 stable
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 63c47e4ac617.
author | Ross Lagerwall <rosslagerwall@gmail.com> |
---|---|
date | Sat, 04 Aug 2012 14:37:17 +0200 |
parents | 67964cda8701 |
children | 099c778ceb33 |
comparison
equal
deleted
inserted
replaced
17333:ba36e771f268 | 17334:39c01f8e7b39 |
---|---|
293 | 293 |
294 conf = config.config() | 294 conf = config.config() |
295 conf.read(mapfile) | 295 conf.read(mapfile) |
296 | 296 |
297 for key, val in conf[''].items(): | 297 for key, val in conf[''].items(): |
298 if not val: | |
299 raise SyntaxError(_('%s: missing value') % conf.source('', key)) | |
298 if val[0] in "'\"": | 300 if val[0] in "'\"": |
299 try: | 301 try: |
300 self.cache[key] = parsestring(val) | 302 self.cache[key] = parsestring(val) |
301 except SyntaxError, inst: | 303 except SyntaxError, inst: |
302 raise SyntaxError('%s: %s' % | 304 raise SyntaxError('%s: %s' % |