comparison mercurial/formatter.py @ 38285: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 395571419274
children 8221df643176
comparison
equal deleted inserted replaced
38284:e72697893c93 38285:8d6109b49b31
365 '''wrap nested data by templatable type''' 365 '''wrap nested data by templatable type'''
366 return templateutil.mappinglist(data, tmpl=tmpl, sep=sep) 366 return templateutil.mappinglist(data, tmpl=tmpl, sep=sep)
367 @staticmethod 367 @staticmethod
368 def formatdate(date, fmt): 368 def formatdate(date, fmt):
369 '''return date tuple''' 369 '''return date tuple'''
370 return date 370 return templateutil.date(date)
371 @staticmethod 371 @staticmethod
372 def formatdict(data, key, value, fmt, sep): 372 def formatdict(data, key, value, fmt, sep):
373 '''build object that can be evaluated as either plain string or dict''' 373 '''build object that can be evaluated as either plain string or dict'''
374 data = util.sortdict(_iteritems(data)) 374 data = util.sortdict(_iteritems(data))
375 def f(): 375 def f():