# HG changeset patch
# User Yuya Nishihara <y...@tcha.org>
# Date 1522590109 -32400
#      Sun Apr 01 22:41:49 2018 +0900
# Node ID a4d06c685ee182279e91c2856d8a69e809c6e317
# Parent  d9f6292315ef2e0000e355cccc3a6dc10c20eefd
hgweb: wrap {archives} with mappinglist

No bare list of mappings should be put in a template mapping.

diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -172,7 +172,7 @@ def rawindexentries(ui, repos, req, subd
                    'description_sort': "",
                    'lastchange': d,
                    'lastchange_sort': d[1] - d[0],
-                   'archives': [],
+                   'archives': templateutil.mappinglist([]),
                    'isdirectory': True,
                    'labels': templateutil.hybridlist([], name='label'),
                    }
diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -35,6 +35,7 @@ from .. import (
     scmutil,
     templatefilters,
     templatekw,
+    templateutil,
     ui as uimod,
     util,
 )
@@ -63,7 +64,7 @@ def archivelist(ui, nodeid, url=None):
                 'url': url,
             })
 
-    return archives
+    return templateutil.mappinglist(archives)
 
 def up(p):
     if p[0:1] != "/":
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to