# HG changeset patch # User Dirkjan Ochtman # Date 1244131550 -7200 # Node ID de6bb29e208a6e1d3e68bc7840e5798377082c30 # Parent dd3ebf81af433e37d301b3093f7e151bb52e01f8 hgweb: allow distinction between open/closed branches on branches page diff -r dd3ebf81af43 -r de6bb29e208a mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Wed Jun 03 17:12:48 2009 -0500 +++ b/mercurial/hgweb/webcommands.py Thu Jun 04 18:05:50 2009 +0200 @@ -361,16 +361,20 @@ def branches(web, req, tmpl): b = web.repo.branchtags() tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems()) + open = set(web.repo[n].branch() for n in web.repo.heads(closed=False)) parity = paritygen(web.stripecount) + sortkey = lambda ctx: ('close' not in ctx.extra(), ctx.rev()) def entries(limit, **map): count = 0 - for ctx in sorted(tips, key=lambda x: x.rev(), reverse=True): + for ctx in sorted(tips, key=sortkey, reverse=True): if limit > 0 and count >= limit: return count += 1 + status = ctx.branch() in open and 'open' or 'closed' yield {'parity': parity.next(), 'branch': ctx.branch(), + 'status': status, 'node': ctx.hex(), 'date': ctx.date()} diff -r dd3ebf81af43 -r de6bb29e208a templates/coal/map --- a/templates/coal/map Wed Jun 03 17:12:48 2009 -0500 +++ b/templates/coal/map Thu Jun 04 18:05:50 2009 +0200 @@ -136,7 +136,7 @@ branchentry = ' - + {branch|escape} diff -r dd3ebf81af43 -r de6bb29e208a templates/gitweb/map --- a/templates/gitweb/map Wed Jun 03 17:12:48 2009 -0500 +++ b/templates/gitweb/map Thu Jun 04 18:05:50 2009 +0200 @@ -165,7 +165,7 @@ {date|age} ago {node|short} - {branch|escape} + {branch|escape} changeset | changelog | diff -r dd3ebf81af43 -r de6bb29e208a templates/monoblue/map --- a/templates/monoblue/map Wed Jun 03 17:12:48 2009 -0500 +++ b/templates/monoblue/map Thu Jun 04 18:05:50 2009 +0200 @@ -142,7 +142,7 @@ {date|age} ago {node|short} - {branch|escape} + {branch|escape} changeset | changelog | diff -r dd3ebf81af43 -r de6bb29e208a templates/paper/map --- a/templates/paper/map Wed Jun 03 17:12:48 2009 -0500 +++ b/templates/paper/map Thu Jun 04 18:05:50 2009 +0200 @@ -136,7 +136,7 @@ branchentry = ' - + {branch|escape} diff -r dd3ebf81af43 -r de6bb29e208a templates/spartan/map --- a/templates/spartan/map Wed Jun 03 17:12:48 2009 -0500 +++ b/templates/spartan/map Thu Jun 04 18:05:50 2009 +0200 @@ -133,7 +133,7 @@ branchentry = '
  • {node} - {branch|escape} + {branch|escape}
  • ' diffblock = '
    {lines}
    ' changelogtag = 'tag:{tag|escape}' diff -r dd3ebf81af43 -r de6bb29e208a templates/static/style-coal.css --- a/templates/static/style-coal.css Wed Jun 03 17:12:48 2009 -0500 +++ b/templates/static/style-coal.css Thu Jun 04 18:05:50 2009 +0200 @@ -196,6 +196,8 @@ .fileline { font-family: monospace; } .fileline img { border: 0; } +.tagEntry .closed { color: #99f; } + /* Changeset entry */ #changesetEntry { border-collapse: collapse; diff -r dd3ebf81af43 -r de6bb29e208a templates/static/style-paper.css --- a/templates/static/style-paper.css Wed Jun 03 17:12:48 2009 -0500 +++ b/templates/static/style-paper.css Thu Jun 04 18:05:50 2009 +0200 @@ -185,6 +185,8 @@ .fileline { font-family: monospace; } .fileline img { border: 0; } +.tagEntry .closed { color: #99f; } + /* Changeset entry */ #changesetEntry { border-collapse: collapse; diff -r dd3ebf81af43 -r de6bb29e208a tests/test-hgweb-commands.out --- a/tests/test-hgweb-commands.out Wed Jun 03 17:12:48 2009 -0500 +++ b/tests/test-hgweb-commands.out Thu Jun 04 18:05:50 2009 +0200 @@ -522,7 +522,7 @@ many years ago 1d22e65f027e -stable +stable changeset | changelog | @@ -532,7 +532,7 @@ many years ago a4f92ed23982 -default +default changeset | changelog | @@ -670,7 +670,7 @@ many years ago 1d22e65f027e -stable +stable changeset | changelog | @@ -680,7 +680,7 @@ many years ago a4f92ed23982 -default +default changeset | changelog |