diff -r 109a6a9dcca8 -r ebc0fa067c07 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Wed Dec 05 15:38:18 2012 -0600 +++ b/mercurial/hgweb/webcommands.py Thu Dec 06 13:21:27 2012 -0600 @@ -437,13 +437,16 @@ latestentry=lambda **x: entries(1, **x)) def branches(web, req, tmpl): - tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems()) + tips = [] heads = web.repo.heads() parity = paritygen(web.stripecount) sortkey = lambda ctx: (not ctx.closesbranch(), ctx.rev()) def entries(limit, **map): count = 0 + if not tips: + for t, n in web.repo.branchtags().iteritems(): + tips.append(web.repo[n]) for ctx in sorted(tips, key=sortkey, reverse=True): if limit > 0 and count >= limit: return