[PATCH 4 of 6] hgweb: wrap {branches} by hybridlist()

Yuya Nishihara yuya at tcha.org
Tue May 8 09:45:31 EDT 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1522595093 -32400
#      Mon Apr 02 00:04:53 2018 +0900
# Node ID 907599bcb465a1f18f77e19e24109f13a2da029b
# Parent  d63045f0f8bb827b8740274c52b7789e30439cb4
hgweb: wrap {branches} by hybridlist()

This is a 0/1-length list of a simple value, can be a hybrid list.

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -253,8 +253,8 @@ def nodebranchdict(repo, ctx):
     except error.RepoLookupError:
         branchnode = None
     if branchnode == ctx.node():
-        branches.append({"name": branch})
-    return branches
+        branches.append(branch)
+    return templateutil.hybridlist(branches, name='name')
 
 def nodeinbranch(repo, ctx):
     branches = []


More information about the Mercurial-devel mailing list