359 latestentry=lambda **x: entries(True,1, **x)) |
359 latestentry=lambda **x: entries(True,1, **x)) |
360 |
360 |
361 def branches(web, req, tmpl): |
361 def branches(web, req, tmpl): |
362 b = web.repo.branchtags() |
362 b = web.repo.branchtags() |
363 tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems()) |
363 tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems()) |
364 open = set(web.repo[n].branch() for n in web.repo.heads(closed=False)) |
364 heads = web.repo.heads() |
365 parity = paritygen(web.stripecount) |
365 parity = paritygen(web.stripecount) |
366 sortkey = lambda ctx: ('close' not in ctx.extra(), ctx.rev()) |
366 sortkey = lambda ctx: ('close' not in ctx.extra(), ctx.rev()) |
367 |
367 |
368 def entries(limit, **map): |
368 def entries(limit, **map): |
369 count = 0 |
369 count = 0 |
370 for ctx in sorted(tips, key=sortkey, reverse=True): |
370 for ctx in sorted(tips, key=sortkey, reverse=True): |
371 if limit > 0 and count >= limit: |
371 if limit > 0 and count >= limit: |
372 return |
372 return |
373 count += 1 |
373 count += 1 |
374 status = ctx.branch() in open and 'open' or 'closed' |
374 if ctx.node() not in heads: |
|
375 status = 'inactive' |
|
376 elif not web.repo.branchheads(ctx.branch()): |
|
377 status = 'closed' |
|
378 else: |
|
379 status = 'open' |
375 yield {'parity': parity.next(), |
380 yield {'parity': parity.next(), |
376 'branch': ctx.branch(), |
381 'branch': ctx.branch(), |
377 'status': status, |
382 'status': status, |
378 'node': ctx.hex(), |
383 'node': ctx.hex(), |
379 'date': ctx.date()} |
384 'date': ctx.date()} |