Show More
@@ -37,29 +37,10 b' def bisect(repo, state):' | |||||
37 | skip = set([changelog.rev(n) for n in state['skip']]) |
|
37 | skip = set([changelog.rev(n) for n in state['skip']]) | |
38 |
|
38 | |||
39 | def buildancestors(bad, good): |
|
39 | def buildancestors(bad, good): | |
40 | # only the earliest bad revision matters |
|
|||
41 | badrev = min([changelog.rev(n) for n in bad]) |
|
40 | badrev = min([changelog.rev(n) for n in bad]) | |
42 | goodrevs = [changelog.rev(n) for n in good] |
|
41 | ancestors = [None] * (len(changelog) + 1) | |
43 | goodrev = min(goodrevs) |
|
42 | for rev in repo.revs("descendants(%ln) - ancestors(%ln)", good, good): | |
44 | # build visit array |
|
|||
45 | ancestors = [None] * (len(changelog) + 1) # an extra for [-1] |
|
|||
46 |
|
||||
47 | # set nodes descended from goodrevs |
|
|||
48 | for rev in goodrevs: |
|
|||
49 | ancestors[rev] = [] |
|
43 | ancestors[rev] = [] | |
50 | for rev in changelog.revs(goodrev + 1): |
|
|||
51 | for prev in clparents(rev): |
|
|||
52 | if ancestors[prev] == []: |
|
|||
53 | ancestors[rev] = [] |
|
|||
54 |
|
||||
55 | # clear good revs from array |
|
|||
56 | for rev in goodrevs: |
|
|||
57 | ancestors[rev] = None |
|
|||
58 | for rev in changelog.revs(len(changelog), goodrev): |
|
|||
59 | if ancestors[rev] is None: |
|
|||
60 | for prev in clparents(rev): |
|
|||
61 | ancestors[prev] = None |
|
|||
62 |
|
||||
63 | if ancestors[badrev] is None: |
|
44 | if ancestors[badrev] is None: | |
64 | return badrev, None |
|
45 | return badrev, None | |
65 | return badrev, ancestors |
|
46 | return badrev, ancestors |
General Comments 0
You need to be logged in to leave comments.
Login now