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

login
register
mail settings
Submitter Antonio Zanardo
Date Feb. 4, 2013, 3:56 p.m.
Message ID <303f2af5f2374d45f623.1359993370@air.local>
Download mbox | patch
Permalink /patch/800/
State Rejected, archived
Delegated to: Matt Mackall
Headers show

Comments

Antonio Zanardo - Feb. 4, 2013, 3:56 p.m.
# HG changeset patch
# User Antonio Zanardo <zanardo@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.
Matt Mackall - Feb. 8, 2013, 8:27 p.m.
On Mon, 2013-02-04 at 13:56 -0200, Antonio Zanardo wrote:
> # HG changeset patch
> # User Antonio Zanardo <zanardo@gmail.com>
> # Date 1359991109 7200
> # Node ID 303f2af5f2374d45f623bc6e5c9e3030c1dd9acd
> # Parent  c4dd3efdf2246f8d80813ea84d7c9f0b45eb046c
> hgweb: group branches by status in gitweb style

Features for hgweb should appear in the default style (paper) first.

Patch

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 @@ 
 <br/>
 </div>
 
-<div class="title">&nbsp;</div>
-<table cellspacing="0">
-{entries%branchentry}
-</table>
+{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>
+')}
 
 {footer}