--- a/mercurial/commands.py Sat Feb 06 19:33:28 2010 +0100
+++ b/mercurial/commands.py Sat Feb 06 19:33:33 2010 +0100
@@ -1417,24 +1417,26 @@
start = None
closed = opts.get('closed')
- hideinactive, _heads = opts.get('active'), None
if not branchrevs:
heads = repo.heads(start)
else:
- if hideinactive:
- dagheads = repo.heads(start)
decode, encode = encoding.fromlocal, encoding.tolocal
branches = set(repo[decode(br)].branch() for br in branchrevs)
heads = []
for b in branches:
- bheads = repo.branchheads(b, start, closed=closed)
- if hideinactive:
- bheads = [bhead for bhead in bheads if bhead in dagheads]
+ bheads = repo.branchheads(b, start, True)
heads.extend(bheads)
+ 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]
+
haveheads = set(repo[h].branch() for h in heads)
if branches - haveheads:
headless = ', '.join(encode(b) for b in branches - haveheads)