changeset 37515:8a5ee6aa8870

hgweb: wrap {archives} with mappinglist No bare list of mappings should be put in a template mapping.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 01 Apr 2018 22:41:49 +0900
parents 034a422aeaff
children 20808ddb4990
files mercurial/hgweb/hgwebdir_mod.py mercurial/hgweb/webutil.py
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Apr 01 22:40:15 2018 +0900
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Apr 01 22:41:49 2018 +0900
@@ -172,7 +172,7 @@
                    'description_sort': "",
                    'lastchange': d,
                    'lastchange_sort': d[1] - d[0],
-                   'archives': [],
+                   'archives': templateutil.mappinglist([]),
                    'isdirectory': True,
                    'labels': templateutil.hybridlist([], name='label'),
                    }
--- a/mercurial/hgweb/webutil.py	Sun Apr 01 22:40:15 2018 +0900
+++ b/mercurial/hgweb/webutil.py	Sun Apr 01 22:41:49 2018 +0900
@@ -35,6 +35,7 @@
     scmutil,
     templatefilters,
     templatekw,
+    templateutil,
     ui as uimod,
     util,
 )
@@ -63,7 +64,7 @@
                 'url': url,
             })
 
-    return archives
+    return templateutil.mappinglist(archives)
 
 def up(p):
     if p[0:1] != "/":