commands: move inactive/closed out so they can have more effect
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Sat, 06 Feb 2010 19:33:33 +0100
changeset 10347 7516716e56dc
parent 10346 e2db50cae6e6
child 10348 0fc5222c0951
commands: move inactive/closed out so they can have more effect
mercurial/commands.py
--- 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)