diff mercurial/revlogutils/deltas.py @ 51342:2e169a222e63

delta-find: fix the computation of the `prev` value The previous computation was "wrong" it always used the tiprev, even when computing a delta in a non-append case (mostly benchmark). This never produced wrong delta on disk, but would misled debug or performance command. Since it does not have any actual user impact, I did not put this on stable. With the code fixed we can now use revisions in some search and it makes the test display more interesting behavior since the algorithm has more to work with.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 23 Nov 2023 21:45:45 +0100
parents 7455cae67260
children 0d92d62ecde0
line wrap: on
line diff
--- a/mercurial/revlogutils/deltas.py	Fri Dec 22 01:33:40 2023 +0100
+++ b/mercurial/revlogutils/deltas.py	Thu Nov 23 21:45:45 2023 +0100
@@ -863,8 +863,7 @@
         assert self.revlog.delta_config.general_delta
         # also see issue6056
         sparse = self.revlog.delta_config.sparse_revlog
-        curr = len(self.revlog)
-        prev = curr - 1
+        prev = self.target_rev - 1
         deltachain = lambda rev: self.revlog._deltachain(rev)[0]
 
         # exclude already lazy tested base if any