# HG changeset patch # User Dirkjan Ochtman # Date 1265481220 -3600 # Node ID 20356e69710c26f1941837ab28c4892187734292 # Parent 0fc5222c095117ada7b11a2ab599f6fa33888d64 commands: actually implement --closed for topological heads diff -r 0fc5222c0951 -r 20356e69710c mercurial/commands.py --- 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) diff -r 0fc5222c0951 -r 20356e69710c tests/test-branches.out --- 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