Bug 4103 - templater: curly braces in a log message are parsed as sub templates
Summary: templater: curly braces in a log message are parsed as sub templates
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 2.8
Hardware: PC Mac OS
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-18 13:52 UTC by Sean Farley
Modified: 2014-01-06 10:48 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Farley 2013-11-18 13:52 UTC
If we run this

$ mkdir hgtmp && cd hgtmp
$ hg init .
$ echo a>>a
$ hg ci -Am 'This should not be a number: {rev}'
$ hg log -r 0 --template '{if(rev, desc)}\n'

it erroneously displays

This should not be a number: 0
Comment 1 HG Bot 2013-11-19 11:45 UTC
Fixed by http://selenic.com/repo/hg/rev/3d8bfe2ecf6d
Matt Mackall <mpm@selenic.com>
templater: only recursively evaluate string literals as templates (issue4103)

(please test the fix)