Patchwork [11,of,13,V2] hgweb: simplify summary with repo.branchmap().iterbranches()

login
register
mail settings
Submitter Brodie Rao
Date Nov. 16, 2013, 4:18 a.m.
Message ID <90231de5bc74c0151a0c.1384575535@hit-nxdomain.opendns.com>
Download mbox | patch
Permalink /patch/2987/
State Accepted
Commit 7d40e706412c54811158a4c0cd7826ee252b12b3
Headers show

Comments

Brodie Rao - Nov. 16, 2013, 4:18 a.m.
# HG changeset patch
# User Brodie Rao <brodie@sf.io>
# Date 1379318909 25200
#      Mon Sep 16 01:08:29 2013 -0700
# Node ID 90231de5bc74c0151a0cbad46d5552a353ca56cf
# Parent  e38e603bbe1fadadb84c537d032b9cf478f67289
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,