comparison mercurial/hgweb/webutil.py @ 37906:a5d16f23a2c9

hgweb: wrap {inbranch} by hybridlist() This is also a 0/1-length list of a simple value, can be a hybrid list.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 02 Apr 2018 00:05:38 +0900
parents f5155bca5023
children 3b3d818bde8b
comparison
equal deleted inserted replaced
37905:f5155bca5023 37906:a5d16f23a2c9
262 try: 262 try:
263 branchnode = repo.branchtip(branch) 263 branchnode = repo.branchtip(branch)
264 except error.RepoLookupError: 264 except error.RepoLookupError:
265 branchnode = None 265 branchnode = None
266 if branch != 'default' and branchnode != ctx.node(): 266 if branch != 'default' and branchnode != ctx.node():
267 branches.append({"name": branch}) 267 branches.append(branch)
268 return branches 268 return templateutil.hybridlist(branches, name='name')
269 269
270 def nodebranchnodefault(ctx): 270 def nodebranchnodefault(ctx):
271 branches = [] 271 branches = []
272 branch = ctx.branch() 272 branch = ctx.branch()
273 if branch != 'default': 273 if branch != 'default':