##// END OF EJS Templates
hgweb: simplify branches with repo.branchmap().iterbranches()
Brodie Rao -
r20194:9985e188 default
parent child Browse files
Show More
@@ -537,18 +537,18 b' def branches(web, req, tmpl):'
537 tips = []
537 tips = []
538 heads = web.repo.heads()
538 heads = web.repo.heads()
539 parity = paritygen(web.stripecount)
539 parity = paritygen(web.stripecount)
540 sortkey = lambda ctx: (not ctx.closesbranch(), ctx.rev())
540 sortkey = lambda item: (not item[1], item[0].rev())
541
541
542 def entries(limit, **map):
542 def entries(limit, **map):
543 count = 0
543 count = 0
544 if not tips:
544 if not tips:
545 for t, n in web.repo.branchtags().iteritems():
545 for tag, hs, tip, closed in web.repo.branchmap().iterbranches():
546 tips.append(web.repo[n])
546 tips.append((web.repo[tip], closed))
547 for ctx in sorted(tips, key=sortkey, reverse=True):
547 for ctx, closed in sorted(tips, key=sortkey, reverse=True):
548 if limit > 0 and count >= limit:
548 if limit > 0 and count >= limit:
549 return
549 return
550 count += 1
550 count += 1
551 if not web.repo.branchheads(ctx.branch()):
551 if closed:
552 status = 'closed'
552 status = 'closed'
553 elif ctx.node() not in heads:
553 elif ctx.node() not in heads:
554 status = 'inactive'
554 status = 'inactive'
General Comments 0
You need to be logged in to leave comments. Login now