# HG changeset patch # User Arun Kulshreshtha # Date 2022-08-23 21:31:19 # Node ID 3ef153aa1eed4ced1f998b93cbb98152d02148a9 # Parent a0b57cabc24543e10ed0583d432709f1c2b7737f 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. diff --git a/mercurial/hbisect.py b/mercurial/hbisect.py --- a/mercurial/hbisect.py +++ b/mercurial/hbisect.py @@ -39,7 +39,7 @@ def bisect(repo, state): 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