diff mercurial/revlog.py @ 47295:21ed126bab53

revlog: fix index computation during inline->non-inline transition The computation in 63edc384d3b7 failed to factor in the index entries themselve as revlog.start() doesn't count them. Found by Valtenin Gatienbaron with a more precise test case from me. Differential Revision: https://phab.mercurial-scm.org/D10724
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 18 May 2021 02:35:27 +0200
parents 25ce16bf724b
children 46b828b85eb7
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed May 19 13:15:00 2021 +0200
+++ b/mercurial/revlog.py	Tue May 18 02:35:27 2021 +0200
@@ -2174,7 +2174,7 @@
             with self._indexfp() as read_ifh:
                 for r in self:
                     new_dfh.write(self._getsegmentforrevs(r, r, df=read_ifh)[1])
-                    if troffset <= self.start(r):
+                    if troffset <= self.start(r) + r * self.index.entry_size:
                         trindex = r
                 new_dfh.flush()