Patchwork [5,of,6] hgweb: wrap {inbranch} by hybridlist()

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

Comments

Yuya Nishihara - May 8, 2018, 1:45 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1522595138 -32400
#      Mon Apr 02 00:05:38 2018 +0900
# Node ID 2fc6f64325ac21c8ed667453c1c62784a082667f
# Parent  907599bcb465a1f18f77e19e24109f13a2da029b
hgweb: wrap {inbranch} by hybridlist()

This is also 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
@@ -264,8 +264,8 @@  def nodeinbranch(repo, ctx):
     except error.RepoLookupError:
         branchnode = None
     if branch != 'default' and branchnode != ctx.node():
-        branches.append({"name": branch})
-    return branches
+        branches.append(branch)
+    return templateutil.hybridlist(branches, name='name')
 
 def nodebranchnodefault(ctx):
     branches = []