Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 10347:7516716e56dc
commands: move inactive/closed out so they can have more effect
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Sat, 06 Feb 2010 19:33:33 +0100 |
parents | e2db50cae6e6 |
children | 0fc5222c0951 |
comparison
equal
deleted
inserted
replaced
10346:e2db50cae6e6 | 10347:7516716e56dc |
---|---|
1415 start = repo.lookup(opts['rev']) | 1415 start = repo.lookup(opts['rev']) |
1416 else: | 1416 else: |
1417 start = None | 1417 start = None |
1418 | 1418 |
1419 closed = opts.get('closed') | 1419 closed = opts.get('closed') |
1420 hideinactive, _heads = opts.get('active'), None | |
1421 if not branchrevs: | 1420 if not branchrevs: |
1422 heads = repo.heads(start) | 1421 heads = repo.heads(start) |
1423 | 1422 |
1424 else: | 1423 else: |
1425 | 1424 |
1426 if hideinactive: | |
1427 dagheads = repo.heads(start) | |
1428 decode, encode = encoding.fromlocal, encoding.tolocal | 1425 decode, encode = encoding.fromlocal, encoding.tolocal |
1429 branches = set(repo[decode(br)].branch() for br in branchrevs) | 1426 branches = set(repo[decode(br)].branch() for br in branchrevs) |
1430 heads = [] | 1427 heads = [] |
1431 | 1428 |
1432 for b in branches: | 1429 for b in branches: |
1433 bheads = repo.branchheads(b, start, closed=closed) | 1430 bheads = repo.branchheads(b, start, True) |
1434 if hideinactive: | |
1435 bheads = [bhead for bhead in bheads if bhead in dagheads] | |
1436 heads.extend(bheads) | 1431 heads.extend(bheads) |
1432 | |
1433 if not opts.get('closed'): | |
1434 heads = [h for h in heads if not repo[h].extra().get('close')] | |
1435 | |
1436 if opts.get('active'): | |
1437 dagheads = repo.heads(start) | |
1438 heads = [h for h in heads if h in dagheads] | |
1437 | 1439 |
1438 haveheads = set(repo[h].branch() for h in heads) | 1440 haveheads = set(repo[h].branch() for h in heads) |
1439 if branches - haveheads: | 1441 if branches - haveheads: |
1440 headless = ', '.join(encode(b) for b in branches - haveheads) | 1442 headless = ', '.join(encode(b) for b in branches - haveheads) |
1441 msg = _('no open branch heads found on branches %s') | 1443 msg = _('no open branch heads found on branches %s') |