Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 16720:e825a89de5d7
context: add changectx.closesbranch() method
This removes the duplicated code for inspecting the 'close' extra field in
a changeset.
author | Brodie Rao <brodie@sf.io> |
---|---|
date | Sun, 13 May 2012 14:04:06 +0200 |
parents | e7bf09acd410 |
children | 3e24ce3de5f1 |
comparison
equal
deleted
inserted
replaced
16719:e7bf09acd410 | 16720:e825a89de5d7 |
---|---|
439 | 439 |
440 def branches(web, req, tmpl): | 440 def branches(web, req, tmpl): |
441 tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems()) | 441 tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems()) |
442 heads = web.repo.heads() | 442 heads = web.repo.heads() |
443 parity = paritygen(web.stripecount) | 443 parity = paritygen(web.stripecount) |
444 sortkey = lambda ctx: ('close' not in ctx.extra(), ctx.rev()) | 444 sortkey = lambda ctx: (not ctx.closesbranch(), ctx.rev()) |
445 | 445 |
446 def entries(limit, **map): | 446 def entries(limit, **map): |
447 count = 0 | 447 count = 0 |
448 for ctx in sorted(tips, key=sortkey, reverse=True): | 448 for ctx in sorted(tips, key=sortkey, reverse=True): |
449 if limit > 0 and count >= limit: | 449 if limit > 0 and count >= limit: |