##// END OF EJS Templates
hbisect: use a defaultdict to avoid large allocations for a large changelogs...
David Soria Parra -
r35128:8287df8b default
parent child Browse files
Show More
@@ -38,7 +38,7 b' def bisect(repo, state):'
38
38
39 def buildancestors(bad, good):
39 def buildancestors(bad, good):
40 badrev = min([changelog.rev(n) for n in bad])
40 badrev = min([changelog.rev(n) for n in bad])
41 ancestors = [None] * (len(changelog) + 1)
41 ancestors = collections.defaultdict(lambda: None)
42 for rev in repo.revs("descendants(%ln) - ancestors(%ln)", good, good):
42 for rev in repo.revs("descendants(%ln) - ancestors(%ln)", good, good):
43 ancestors[rev] = []
43 ancestors[rev] = []
44 if ancestors[badrev] is None:
44 if ancestors[badrev] is None:
General Comments 0
You need to be logged in to leave comments. Login now