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

login
register
mail settings
Submitter Yuya Nishihara
Date May 8, 2018, 1:45 p.m.
Message ID <907599bcb465a1f18f77.1525787131@mimosa>
Download mbox | patch
Permalink /patch/31378/
State Accepted
Headers show

Comments

Yuya Nishihara - May 8, 2018, 1:45 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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.

Patch

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 = []