[PATCH] hgweb: treat branch attribute `closed' as more important than `inactive'

jpl at unknown.za.net jpl at unknown.za.net
Wed Jun 29 02:47:16 CDT 2011


# HG changeset patch
# User Jesse Long <jpl at unknown.za.net>
# Date 1309333005 -7200
# Node ID cd2dce65c26c0150dfc75fabcb66697d6242f998
# Parent  c64bd320e4f0a0bf36f64292900822e6f1f09a56
hgweb: treat branch attribute `closed' as more important than `inactive'

In the branches page, branches that are closed and are merged into another
branch are displayed as `inactive'. This patch changes that behaviour to
show these branches as `closed'.

For me, the `closed' attribute is more important than the `inactive'
attribute.

Branches that are not closed, and are merged into other branches will still
be shown as `inactive'.

Branches that are closed, and are not merged into other branches will still
be shown as `closed'.

diff -r c64bd320e4f0 -r cd2dce65c26c mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Mon Jun 27 16:39:02 2011 -0500
+++ b/mercurial/hgweb/webcommands.py	Wed Jun 29 09:36:45 2011 +0200
@@ -432,10 +432,10 @@
             if limit > 0 and count >= limit:
                 return
             count += 1
-            if ctx.node() not in heads:
+            if not web.repo.branchheads(ctx.branch()):
+                status = 'closed'
+            elif ctx.node() not in heads:
                 status = 'inactive'
-            elif not web.repo.branchheads(ctx.branch()):
-                status = 'closed'
             else:
                 status = 'open'
             yield {'parity': parity.next(),


More information about the Mercurial-devel mailing list