Mercurial > public > mercurial-scm > hg
diff mercurial/templateutil.py @ 37225:e70a90a72b80
templatefuncs: use evaldate() where seems appropriate
This means date("today") is allowed.
Also fixes evaldate() to forcibly use the custom error message if specified.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 18 Mar 2018 15:58:22 +0900 |
parents | 67efce231633 |
children | 920589f52be9 |
line wrap: on
line diff
--- a/mercurial/templateutil.py Sun Mar 18 15:55:31 2018 +0900 +++ b/mercurial/templateutil.py Sun Mar 18 15:58:22 2018 +0900 @@ -330,6 +330,10 @@ return dateutil.parsedate(thing) except AttributeError: raise error.ParseError(err or _('not a date tuple nor a string')) + except error.ParseError: + if not err: + raise + raise error.ParseError(err) def evalinteger(context, mapping, arg, err=None): return unwrapinteger(evalrawexp(context, mapping, arg), err)