Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templatekw.py @ 38310:88e7105b5cd9
templater: restore the original string format of {date}
Unfortunately, python-hglib relies on that. I could fix python-hglib, but
there would be other tools that take a decimal separator as the separator
of unixtime and tzoffset.
The showfmt is set per instance since new code uses '%d %d' format by default.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 13 Jun 2018 21:57:24 +0900 |
parents | 8d6109b49b31 |
children | 523f64466a05 |
line wrap: on
line diff
--- a/mercurial/templatekw.py Tue Jun 12 20:43:56 2018 -0400 +++ b/mercurial/templatekw.py Wed Jun 13 21:57:24 2018 +0900 @@ -240,7 +240,9 @@ def showdate(context, mapping): """Date information. The date when the changeset was committed.""" ctx = context.resource(mapping, 'ctx') - return templateutil.date(ctx.date()) + # the default string format is '<float(unixtime)><tzoffset>' because + # python-hglib splits date at decimal separator. + return templateutil.date(ctx.date(), showfmt='%d.0%d') @templatekeyword('desc', requires={'ctx'}) def showdescription(context, mapping):