comparison mercurial/commands.py @ 10349:20356e69710c

commands: actually implement --closed for topological heads
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sat, 06 Feb 2010 19:33:40 +0100
parents 0fc5222c0951
children fd511e9eeea6
comparison
equal deleted inserted replaced
10348:0fc5222c0951 10349:20356e69710c
1434 startrev = repo.changelog.rev(start) 1434 startrev = repo.changelog.rev(start)
1435 descendants = set(repo.changelog.descendants(startrev)) 1435 descendants = set(repo.changelog.descendants(startrev))
1436 descendants.add(startrev) 1436 descendants.add(startrev)
1437 heads += [h for h in ls if repo.changelog.rev(h) in descendants] 1437 heads += [h for h in ls if repo.changelog.rev(h) in descendants]
1438 1438
1439 if not opts.get('closed'): 1439 if not opts.get('closed'):
1440 heads = [h for h in heads if not repo[h].extra().get('close')] 1440 heads = [h for h in heads if not repo[h].extra().get('close')]
1441 1441
1442 if opts.get('active'): 1442 if opts.get('active') and branchrevs:
1443 dagheads = repo.heads(start) 1443 dagheads = repo.heads(start)
1444 heads = [h for h in heads if h in dagheads] 1444 heads = [h for h in heads if h in dagheads]
1445 1445
1446 if branchrevs:
1446 haveheads = set(repo[h].branch() for h in heads) 1447 haveheads = set(repo[h].branch() for h in heads)
1447 if branches - haveheads: 1448 if branches - haveheads:
1448 headless = ', '.join(encode(b) for b in branches - haveheads) 1449 headless = ', '.join(encode(b) for b in branches - haveheads)
1449 msg = _('no open branch heads found on branches %s') 1450 msg = _('no open branch heads found on branches %s')
1450 if opts.get('rev'): 1451 if opts.get('rev'):