comparison mercurial/commands.py @ 10348:0fc5222c0951

commands: externalize branchheads so we can do it for all branches at once
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sat, 06 Feb 2010 19:06:02 +0100
parents 7516716e56dc
children 20356e69710c
comparison
equal deleted inserted replaced
10347:7516716e56dc 10348:0fc5222c0951
1421 heads = repo.heads(start) 1421 heads = repo.heads(start)
1422 1422
1423 else: 1423 else:
1424 1424
1425 decode, encode = encoding.fromlocal, encoding.tolocal 1425 decode, encode = encoding.fromlocal, encoding.tolocal
1426 heads = []
1426 branches = set(repo[decode(br)].branch() for br in branchrevs) 1427 branches = set(repo[decode(br)].branch() for br in branchrevs)
1427 heads = [] 1428 for b, ls in repo.branchmap().iteritems():
1428 1429 if b not in branches:
1429 for b in branches: 1430 continue
1430 bheads = repo.branchheads(b, start, True) 1431 if start is None:
1431 heads.extend(bheads) 1432 heads += ls
1433 continue
1434 startrev = repo.changelog.rev(start)
1435 descendants = set(repo.changelog.descendants(startrev))
1436 descendants.add(startrev)
1437 heads += [h for h in ls if repo.changelog.rev(h) in descendants]
1432 1438
1433 if not opts.get('closed'): 1439 if not opts.get('closed'):
1434 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')]
1435 1441
1436 if opts.get('active'): 1442 if opts.get('active'):