--- 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)