bisect: bypass changectx when translating revs to nodes
authorArun Kulshreshtha <akulshreshtha@janestreet.com>
Tue, 23 Aug 2022 17:31:13 -0400
changeset 49440 a0b57cabc245
parent 49439 b07465adbcc8
child 49441 3ef153aa1eed
bisect: bypass changectx when translating revs to nodes When resolving the revset given by the user into node hashes, use the changelog to perform the translation rather than the repo object. This avoids the overhead of constructing a changectx which is immediately discarded.
mercurial/commands.py
--- a/mercurial/commands.py	Wed Aug 24 16:38:13 2022 +0100
+++ b/mercurial/commands.py	Tue Aug 23 17:31:13 2022 -0400
@@ -1035,7 +1035,7 @@
     state = hbisect.load_state(repo)
 
     if rev:
-        nodes = [repo[i].node() for i in logcmdutil.revrange(repo, rev)]
+        nodes = [repo.changelog.node(i) for i in logcmdutil.revrange(repo, rev)]
     else:
         nodes = [repo.lookup(b'.')]