mercurial/hgweb/webcommands.py
changeset 18037 c8326ffdcb4f
parent 17991 d605a82cf189
parent 18030 ebc0fa067c07
child 18319 e350ce798b63
equal deleted inserted replaced
18036:8b846dbc57b6 18037:c8326ffdcb4f
   397                 bookmarks=webutil.nodebookmarksdict(web.repo, node),
   397                 bookmarks=webutil.nodebookmarksdict(web.repo, node),
   398                 inbranch=webutil.nodeinbranch(web.repo, ctx),
   398                 inbranch=webutil.nodeinbranch(web.repo, ctx),
   399                 branches=webutil.nodebranchdict(web.repo, ctx))
   399                 branches=webutil.nodebranchdict(web.repo, ctx))
   400 
   400 
   401 def tags(web, req, tmpl):
   401 def tags(web, req, tmpl):
   402     i = reversed(web.repo.tagslist())
   402     i = list(reversed(web.repo.tagslist()))
   403     parity = paritygen(web.stripecount)
   403     parity = paritygen(web.stripecount)
   404 
   404 
   405     def entries(notip=False, limit=0, **map):
   405     def entries(notip=False, limit=0, **map):
   406         count = 0
   406         count = 0
   407         for k, n in i:
   407         for k, n in i:
   440                 node=hex(web.repo.changelog.tip()),
   440                 node=hex(web.repo.changelog.tip()),
   441                 entries=lambda **x: entries(0, **x),
   441                 entries=lambda **x: entries(0, **x),
   442                 latestentry=lambda **x: entries(1, **x))
   442                 latestentry=lambda **x: entries(1, **x))
   443 
   443 
   444 def branches(web, req, tmpl):
   444 def branches(web, req, tmpl):
   445     tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems())
   445     tips = []
   446     heads = web.repo.heads()
   446     heads = web.repo.heads()
   447     parity = paritygen(web.stripecount)
   447     parity = paritygen(web.stripecount)
   448     sortkey = lambda ctx: (not ctx.closesbranch(), ctx.rev())
   448     sortkey = lambda ctx: (not ctx.closesbranch(), ctx.rev())
   449 
   449 
   450     def entries(limit, **map):
   450     def entries(limit, **map):
   451         count = 0
   451         count = 0
       
   452         if not tips:
       
   453             for t, n in web.repo.branchtags().iteritems():
       
   454                 tips.append(web.repo[n])
   452         for ctx in sorted(tips, key=sortkey, reverse=True):
   455         for ctx in sorted(tips, key=sortkey, reverse=True):
   453             if limit > 0 and count >= limit:
   456             if limit > 0 and count >= limit:
   454                 return
   457                 return
   455             count += 1
   458             count += 1
   456             if not web.repo.branchheads(ctx.branch()):
   459             if not web.repo.branchheads(ctx.branch()):