Mercurial > hg
comparison mercurial/hgweb/webutil.py @ 37905:f5155bca5023
hgweb: wrap {branches} by hybridlist()
This is 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:04:53 +0900 |
parents | 40a664bd06fa |
children | a5d16f23a2c9 |
comparison
equal
deleted
inserted
replaced
37904:40a664bd06fa | 37905:f5155bca5023 |
---|---|
251 try: | 251 try: |
252 branchnode = repo.branchtip(branch) | 252 branchnode = repo.branchtip(branch) |
253 except error.RepoLookupError: | 253 except error.RepoLookupError: |
254 branchnode = None | 254 branchnode = None |
255 if branchnode == ctx.node(): | 255 if branchnode == ctx.node(): |
256 branches.append({"name": branch}) | 256 branches.append(branch) |
257 return branches | 257 return templateutil.hybridlist(branches, name='name') |
258 | 258 |
259 def nodeinbranch(repo, ctx): | 259 def nodeinbranch(repo, ctx): |
260 branches = [] | 260 branches = [] |
261 branch = ctx.branch() | 261 branch = ctx.branch() |
262 try: | 262 try: |