Mercurial > hg > mercurial-source
diff mercurial/templateutil.py @ 38011: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 +++ b/mercurial/templateutil.py @@ -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)