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

Brodie Rao brodie at sf.io
Fri Nov 15 22:18:55 CST 2013


# HG changeset patch
# User Brodie Rao <brodie at 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()

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,


More information about the Mercurial-devel mailing list