comparison mercurial/hgweb/webcommands.py @ 38168:5e94d07b290a

hgweb: wrap {lastchange} of bookmarks with mappinglist It was an 1-length list of a mapping, can be wrapped with a mappinglist.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 04 Apr 2018 20:21:29 +0900
parents edacd831afab
children e4a43d261715
comparison
equal deleted inserted replaced
38167:edacd831afab 38168:5e94d07b290a
660 660
661 if i: 661 if i:
662 latestrev = i[0][1] 662 latestrev = i[0][1]
663 else: 663 else:
664 latestrev = -1 664 latestrev = -1
665 lastdate = web.repo[latestrev].date()
665 666
666 return web.sendtemplate( 667 return web.sendtemplate(
667 'bookmarks', 668 'bookmarks',
668 node=hex(web.repo.changelog.tip()), 669 node=hex(web.repo.changelog.tip()),
669 lastchange=[{'date': web.repo[latestrev].date()}], 670 lastchange=templateutil.mappinglist([{'date': lastdate}]),
670 entries=templateutil.mappinggenerator(entries, args=(False,)), 671 entries=templateutil.mappinggenerator(entries, args=(False,)),
671 latestentry=templateutil.mappinggenerator(entries, args=(True,))) 672 latestentry=templateutil.mappinggenerator(entries, args=(True,)))
672 673
673 @webcommand('branches') 674 @webcommand('branches')
674 def branches(web): 675 def branches(web):