[PATCH 2 of 8] hgweb: wrap {lastchange} of bookmarks with mappinglist
Yuya Nishihara
yuya at tcha.org
Mon May 21 08:22:39 EDT 2018
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1522840889 -32400
# Wed Apr 04 20:21:29 2018 +0900
# Node ID 45d63bc6a089475a963400047b3c9ee8dd75eeeb
# Parent 56e8ac64a7a3d529a596778d16ffc442a87f96e6
hgweb: wrap {lastchange} of bookmarks with mappinglist
It was an 1-length list of a mapping, can be wrapped with a mappinglist.
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -662,11 +662,12 @@ def bookmarks(web):
latestrev = i[0][1]
else:
latestrev = -1
+ lastdate = web.repo[latestrev].date()
return web.sendtemplate(
'bookmarks',
node=hex(web.repo.changelog.tip()),
- lastchange=[{'date': web.repo[latestrev].date()}],
+ lastchange=templateutil.mappinglist([{'date': lastdate}]),
entries=templateutil.mappinggenerator(entries, args=(False,)),
latestentry=templateutil.mappinggenerator(entries, args=(True,)))
More information about the Mercurial-devel
mailing list