Mercurial > hg
changeset 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 |
files | mercurial/commands.py tests/test-branches.out |
diffstat | 2 files changed, 8 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Feb 06 19:06:02 2010 +0100 +++ b/mercurial/commands.py Sat Feb 06 19:33:40 2010 +0100 @@ -1436,13 +1436,14 @@ descendants.add(startrev) heads += [h for h in ls if repo.changelog.rev(h) in descendants] - if not opts.get('closed'): - heads = [h for h in heads if not repo[h].extra().get('close')] - - if opts.get('active'): - dagheads = repo.heads(start) - heads = [h for h in heads if h in dagheads] - + if not opts.get('closed'): + heads = [h for h in heads if not repo[h].extra().get('close')] + + if opts.get('active') and branchrevs: + dagheads = repo.heads(start) + heads = [h for h in heads if h in dagheads] + + if branchrevs: haveheads = set(repo[h].branch() for h in heads) if branches - haveheads: headless = ', '.join(encode(b) for b in branches - haveheads)
--- a/tests/test-branches.out Sat Feb 06 19:06:02 2010 +0100 +++ b/tests/test-branches.out Sat Feb 06 19:33:40 2010 +0100 @@ -143,12 +143,6 @@ date: Thu Jan 01 00:00:09 1970 +0000 summary: reopen branch with a change -changeset: 11:c84627f3c15d -branch: b -user: test -date: Thu Jan 01 00:00:09 1970 +0000 -summary: prune bad branch - changeset: 7:10ff5895aa57 branch: a branch name much longer than the default justification used by branches user: test