changeset 49441:3ef153aa1eed

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.
author Arun Kulshreshtha <akulshreshtha@janestreet.com>
date Tue, 23 Aug 2022 17:31:19 -0400
parents a0b57cabc245
children 816236523765
files mercurial/hbisect.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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