bisect: limit ancestors to revs topologically between good and bad revs
Previously, when constructing its dict of revisions to their ancestors, bisect
would populate the dict with ALL of the descendents of the good set, which is
a bit silly because it is impossible for a revision that is a descendent of the
minimum known bad revision to be the first bad rev. Instead it makes more sense
to limit the revisions to just those topologically between the good and bad.
--- a/mercurial/hbisect.py Tue Aug 23 17:31:13 2022 -0400
+++ b/mercurial/hbisect.py Tue Aug 23 17:31:19 2022 -0400
@@ -39,7 +39,7 @@
def buildancestors(bad, good):
badrev = min([changelog.rev(n) for n in bad])
ancestors = collections.defaultdict(lambda: None)
- for rev in repo.revs(b"descendants(%ln) - ancestors(%ln)", good, good):
+ for rev in repo.revs(b"(%ln::%d) - (::%ln)", good, badrev, good):
ancestors[rev] = []
if ancestors[badrev] is None:
return badrev, None