diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -361,16 +361,20 @@ def tags(web, req, tmpl): 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 --git a/templates/coal/map b/templates/coal/map --- a/templates/coal/map +++ b/templates/coal/map @@ -136,7 +136,7 @@ branches = ../paper/branches.tmpl branchentry = ' - + {branch|escape} diff --git a/templates/gitweb/map b/templates/gitweb/map --- a/templates/gitweb/map +++ b/templates/gitweb/map @@ -165,7 +165,7 @@ branchentry = ' {date|age} ago {node|short} - {branch|escape} + {branch|escape} changeset | changelog | diff --git a/templates/monoblue/map b/templates/monoblue/map --- a/templates/monoblue/map +++ b/templates/monoblue/map @@ -142,7 +142,7 @@ branchentry = ' {date|age} ago {node|short} - {branch|escape} + {branch|escape} changeset | changelog | diff --git a/templates/paper/map b/templates/paper/map --- a/templates/paper/map +++ b/templates/paper/map @@ -136,7 +136,7 @@ branches = branches.tmpl branchentry = ' - + {branch|escape} diff --git a/templates/spartan/map b/templates/spartan/map --- a/templates/spartan/map +++ b/templates/spartan/map @@ -133,7 +133,7 @@ branches = branches.tmpl branchentry = '
  • {node} - {branch|escape} + {branch|escape}
  • ' diffblock = '
    {lines}
    ' changelogtag = 'tag:{tag|escape}' diff --git a/templates/static/style-coal.css b/templates/static/style-coal.css --- a/templates/static/style-coal.css +++ b/templates/static/style-coal.css @@ -196,6 +196,8 @@ h3 { .fileline { font-family: monospace; } .fileline img { border: 0; } +.tagEntry .closed { color: #99f; } + /* Changeset entry */ #changesetEntry { border-collapse: collapse; diff --git a/templates/static/style-paper.css b/templates/static/style-paper.css --- a/templates/static/style-paper.css +++ b/templates/static/style-paper.css @@ -185,6 +185,8 @@ h3 { .fileline { font-family: monospace; } .fileline img { border: 0; } +.tagEntry .closed { color: #99f; } + /* Changeset entry */ #changesetEntry { border-collapse: collapse; diff --git a/tests/test-hgweb-commands.out b/tests/test-hgweb-commands.out --- a/tests/test-hgweb-commands.out +++ b/tests/test-hgweb-commands.out @@ -522,7 +522,7 @@ branches | many years ago 1d22e65f027e -stable +stable changeset | changelog | @@ -532,7 +532,7 @@ branches | many years ago a4f92ed23982 -default +default changeset | changelog | @@ -670,7 +670,7 @@ summary | many years ago 1d22e65f027e -stable +stable changeset | changelog | @@ -680,7 +680,7 @@ summary | many years ago a4f92ed23982 -default +default changeset | changelog |