[PATCH 2 of 2] hgweb: group branches by status in gitweb style

Antonio Zanardo zanardo at gmail.com
Mon Feb 4 09:56:10 CST 2013

# HG changeset patch
# User Antonio Zanardo <zanardo at gmail.com>
# Date 1359991109 7200
# Node ID 303f2af5f2374d45f623bc6e5c9e3030c1dd9acd
# Parent  c4dd3efdf2246f8d80813ea84d7c9f0b45eb046c
hgweb: group branches by status in gitweb style

In the 'branches' template, we do now split branches list by their status. Open
and inactive branches go in the 'open branches' list, and closed branches go on
'closed branches' list.

By default, the closed branches group lists only the first ten closed branches
(ordered by descending age), but a '...' link on the bottom of the list make the
page reload and all closed branches are shown.

Each list is only displayed in case there is at least one branch in the
respective list.

diff --git a/mercurial/templates/gitweb/branches.tmpl b/mercurial/templates/gitweb/branches.tmpl
--- a/mercurial/templates/gitweb/branches.tmpl
+++ b/mercurial/templates/gitweb/branches.tmpl
@@ -25,9 +25,19 @@
-<div class="title"> </div>
-<table cellspacing="0">
+{if(entriesopen, '
+	<div class="title">open branches</div>
+	<table cellspacing="0">
+		{entriesopen%branchentry}
+	</table>
+{if(entriesclosed, '
+	<div class="title">closed branches</div>
+	<table cellspacing="0">
+		{entriesclosed%branchentry}
+		<tr class="light"><td colspan="3"><a class="list" href="{url|urlescape}branches{allclosedvars%urlparameter}">...</a></td></tr>
+	</table>

More information about the Mercurial-devel mailing list