comparison mercurial/cmdutil.py @ 35900:72de5c504833

py3: factor out helpers to apply string conversion recursively
author Yuya Nishihara <yuya@tcha.org>
date Sat, 27 Jan 2018 13:33:31 +0900
parents c8e2d6ed1f9e
children 1a31111e6239
comparison
equal deleted inserted replaced
35899:d5457d94e1c9 35900:72de5c504833
1592 fm.write('parentnodes', '{%s} ', 1592 fm.write('parentnodes', '{%s} ',
1593 fm.formatlist(map(hex, parents), name='node', sep=', ')) 1593 fm.formatlist(map(hex, parents), name='node', sep=', '))
1594 fm.write('date', '(%s) ', fm.formatdate(marker.date())) 1594 fm.write('date', '(%s) ', fm.formatdate(marker.date()))
1595 meta = marker.metadata().copy() 1595 meta = marker.metadata().copy()
1596 meta.pop('date', None) 1596 meta.pop('date', None)
1597 smeta = {_maybebytestr(k): _maybebytestr(v) for k, v in meta.iteritems()} 1597 smeta = util.rapply(_maybebytestr, meta)
1598 fm.write('metadata', '{%s}', fm.formatdict(smeta, fmt='%r: %r', sep=', ')) 1598 fm.write('metadata', '{%s}', fm.formatdict(smeta, fmt='%r: %r', sep=', '))
1599 fm.plain('\n') 1599 fm.plain('\n')
1600 1600
1601 def finddate(ui, repo, date): 1601 def finddate(ui, repo, date):
1602 """Find the tipmost changeset that matches the given date spec""" 1602 """Find the tipmost changeset that matches the given date spec"""