Patchwork [2,of,8] hgweb: wrap {lastchange} of bookmarks with mappinglist

login
register
mail settings
Submitter Yuya Nishihara
Date May 21, 2018, 12:22 p.m.
Message ID <45d63bc6a089475a9634.1526905359@mimosa>
Download mbox | patch
Permalink /patch/31769/
State Accepted
Headers show

Comments

Yuya Nishihara - May 21, 2018, 12:22 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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.

Patch

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,)))