graphlog: use a set for inclusion test
This makes a big difference in performance in the special case where all
revisions are being graphed.
--- a/mercurial/graphmod.py Sat Apr 30 15:10:58 2011 +0300
+++ b/mercurial/graphmod.py Sat Apr 30 19:42:00 2011 +0200
@@ -36,9 +36,11 @@
lowestrev = min(revs)
gpcache = {}
+ knownrevs = set(revs)
for rev in revs:
ctx = repo[rev]
- parents = sorted(set([p.rev() for p in ctx.parents() if p.rev() in revs]))
+ parents = sorted(set([p.rev() for p in ctx.parents()
+ if p.rev() in knownrevs]))
mpars = [p.rev() for p in ctx.parents() if
p.rev() != nullrev and p.rev() not in parents]