--- a/mercurial/commands.py Sat Feb 06 19:33:33 2010 +0100
+++ b/mercurial/commands.py Sat Feb 06 19:06:02 2010 +0100
@@ -1423,12 +1423,18 @@
else:
decode, encode = encoding.fromlocal, encoding.tolocal
+ heads = []
branches = set(repo[decode(br)].branch() for br in branchrevs)
- heads = []
-
- for b in branches:
- bheads = repo.branchheads(b, start, True)
- heads.extend(bheads)
+ for b, ls in repo.branchmap().iteritems():
+ if b not in branches:
+ continue
+ if start is None:
+ heads += ls
+ continue
+ startrev = repo.changelog.rev(start)
+ descendants = set(repo.changelog.descendants(startrev))
+ 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')]