##// END OF EJS Templates
bisect: avoid copying ancestor list for non-merge commits...
Arun Kulshreshtha -
r50386:c6a1beba default
parent child Browse files
Show More
@@ -115,11 +115,21 b' def bisect(repo, state):'
115 poison.update(children.get(rev, []))
115 poison.update(children.get(rev, []))
116 continue
116 continue
117
117
118 unvisited = []
118 for c in children.get(rev, []):
119 for c in children.get(rev, []):
119 if ancestors[c]:
120 if ancestors[c]:
120 ancestors[c] = list(set(ancestors[c] + a))
121 ancestors[c] = list(set(ancestors[c] + a))
121 else:
122 else:
123 unvisited.append(c)
124
125 # Reuse existing ancestor list for the first unvisited child to avoid
126 # excessive copying for linear portions of history.
127 if unvisited:
128 first = unvisited.pop(0)
129 for c in unvisited:
122 ancestors[c] = a + [c]
130 ancestors[c] = a + [c]
131 a.append(first)
132 ancestors[first] = a
123
133
124 assert best_rev is not None
134 assert best_rev is not None
125 best_node = changelog.node(best_rev)
135 best_node = changelog.node(best_rev)
General Comments 0
You need to be logged in to leave comments. Login now