equal
deleted
inserted
replaced
85 best_rev = None |
85 best_rev = None |
86 best_len = -1 |
86 best_len = -1 |
87 poison = set() |
87 poison = set() |
88 for rev in candidates: |
88 for rev in candidates: |
89 if rev in poison: |
89 if rev in poison: |
90 for c in children.get(rev, []): |
90 # poison children |
91 poison.add(c) # poison children |
91 poison.update(children.get(rev, [])) |
92 continue |
92 continue |
93 |
93 |
94 a = ancestors[rev] or [rev] |
94 a = ancestors[rev] or [rev] |
95 ancestors[rev] = None |
95 ancestors[rev] = None |
96 |
96 |
102 best_rev = rev |
102 best_rev = rev |
103 if value == perfect: # found a perfect candidate? quit early |
103 if value == perfect: # found a perfect candidate? quit early |
104 break |
104 break |
105 |
105 |
106 if y < perfect and rev not in skip: # all downhill from here? |
106 if y < perfect and rev not in skip: # all downhill from here? |
107 for c in children.get(rev, []): |
107 # poison children |
108 poison.add(c) # poison children |
108 poison.update(children.get(rev, [])) |
109 continue |
109 continue |
110 |
110 |
111 for c in children.get(rev, []): |
111 for c in children.get(rev, []): |
112 if ancestors[c]: |
112 if ancestors[c]: |
113 ancestors[c] = list(set(ancestors[c] + a)) |
113 ancestors[c] = list(set(ancestors[c] + a)) |