Patchwork [10,of,12] hgweb: simplify summary with repo.branchmap().iterbranches()

login
register
mail settings
Submitter Brodie Rao
Date Nov. 16, 2013, 2:27 a.m.
Message ID <0cc37ae6a1060456c078.1384568862@hit-nxdomain.opendns.com>
Download mbox | patch
Permalink /patch/2968/
State Superseded
Headers show

Comments

Brodie Rao - Nov. 16, 2013, 2:27 a.m.
# HG changeset patch
# User Brodie Rao <brodie@sf.io>
# Date 1379318909 25200
#      Mon Sep 16 01:08:29 2013 -0700
# Node ID 0cc37ae6a1060456c0787d16ef2ee3fc9be5a90b
# Parent  9462a9de6b32e3764ac5ced6397bdbfc851b2399
hgweb: simplify summary with repo.branchmap().iterbranches()

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -590,8 +590,9 @@  def summary(web, req, tmpl):
     def branches(**map):
         parity = paritygen(web.stripecount)
 
-        b = web.repo.branchtags()
-        l = [(-web.repo.changelog.rev(n), n, t) for t, n in b.iteritems()]
+        b = web.repo.branchmap()
+        l = [(-web.repo.changelog.rev(tip), tip, tag)
+             for tag, heads, tip, closed in b.iterbranches()]
         for r, n, t in sorted(l):
             yield {'parity': parity.next(),
                    'branch': t,