hgweb: wrap {archives} with mappinglist
authorYuya Nishihara <yuya@tcha.org>
Sun, 01 Apr 2018 22:41:49 +0900
changeset 37515 8a5ee6aa8870
parent 37514 034a422aeaff
child 37516 20808ddb4990
hgweb: wrap {archives} with mappinglist No bare list of mappings should be put in a template mapping.
mercurial/hgweb/hgwebdir_mod.py
mercurial/hgweb/webutil.py
--- 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] != "/":