comparison mercurial/hgweb/hgweb_mod.py @ 37509:cb7b275c0cd0

hgweb: wrap {pathdef} 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:14:36 +0900
parents 08e042f0a67c
children 356e61e82c2a
comparison
equal deleted inserted replaced
37508:30a7b32897f1 37509:cb7b275c0cd0
29 pycompat, 29 pycompat,
30 registrar, 30 registrar,
31 repoview, 31 repoview,
32 templatefilters, 32 templatefilters,
33 templater, 33 templater,
34 templateutil,
34 ui as uimod, 35 ui as uimod,
35 util, 36 util,
36 wireprotoserver, 37 wireprotoserver,
37 ) 38 )
38 39
78 for pathel in reversed(pathitems): 79 for pathel in reversed(pathitems):
79 if not pathel or not urlel: 80 if not pathel or not urlel:
80 break 81 break
81 breadcrumb.append({'url': urlel, 'name': pathel}) 82 breadcrumb.append({'url': urlel, 'name': pathel})
82 urlel = os.path.dirname(urlel) 83 urlel = os.path.dirname(urlel)
83 return reversed(breadcrumb) 84 return templateutil.mappinglist(reversed(breadcrumb))
84 85
85 class requestcontext(object): 86 class requestcontext(object):
86 """Holds state/context for an individual request. 87 """Holds state/context for an individual request.
87 88
88 Servers can be multi-threaded. Holding state on the WSGI application 89 Servers can be multi-threaded. Holding state on the WSGI application