diff mercurial/hgweb/webcommands.py @ 18037:c8326ffdcb4f

merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 06 Dec 2012 16:42:15 -0600
parents d605a82cf189 ebc0fa067c07
children e350ce798b63
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Tue Dec 04 12:54:18 2012 -0800
+++ b/mercurial/hgweb/webcommands.py	Thu Dec 06 16:42:15 2012 -0600
@@ -399,7 +399,7 @@
                 branches=webutil.nodebranchdict(web.repo, ctx))
 
 def tags(web, req, tmpl):
-    i = reversed(web.repo.tagslist())
+    i = list(reversed(web.repo.tagslist()))
     parity = paritygen(web.stripecount)
 
     def entries(notip=False, limit=0, **map):
@@ -442,13 +442,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