diff mercurial/templatefuncs.py @ 38297:8d6109b49b31

templater: introduce a wrapper for date tuple (BC) Strictly speaking, this is BC, but I believe the original string format (str(float(unixtime)) + str(int(tzoffset))) was just plain wrong.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 24 Mar 2018 17:54:02 +0900
parents fb874fc1d9b4
children 4b73f316ba0e
line wrap: on
line diff
--- a/mercurial/templatefuncs.py	Sat Apr 21 19:01:35 2018 +0900
+++ b/mercurial/templatefuncs.py	Sat Mar 24 17:54:02 2018 +0900
@@ -391,7 +391,7 @@
                 raise error.ParseError(_("localdate expects a timezone"))
     else:
         tzoffset = dateutil.makedate()[1]
-    return (date[0], tzoffset)
+    return templateutil.date((date[0], tzoffset))
 
 @templatefunc('max(iterable)')
 def max_(context, mapping, args, **kwargs):
@@ -461,6 +461,7 @@
     markers = evalfuncarg(context, mapping, args[0])
 
     try:
+        # TODO: maybe this has to be a wrapped list of date wrappers?
         data = obsutil.markersdates(markers)
         return templateutil.hybridlist(data, name='date', fmt='%d %d')
     except (TypeError, KeyError):