diff mercurial/revlog.py @ 51025:509f0f7fc89e

delta-computer: stop explicitly taking file handle The revlog has all the logic for opening and caching such handles, so no need to duplicate it here. In addition, this let the revlog handle that logic by itself which is better.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 25 Sep 2023 22:51:57 +0200
parents 720e5a5f2b95
children 33d2f0164d0d
line wrap: on
line diff
--- a/mercurial/revlog.py	Mon Sep 25 16:47:55 2023 +0200
+++ b/mercurial/revlog.py	Mon Sep 25 22:51:57 2023 +0200
@@ -2580,11 +2580,6 @@
             msg = b'adding revision outside `revlog._writing` context'
             raise error.ProgrammingError(msg)
 
-        if self._inline:
-            fh = self._writinghandles[0]
-        else:
-            fh = self._writinghandles[1]
-
         btext = [rawtext]
 
         curr = len(self)
@@ -2650,7 +2645,7 @@
             flags,
         )
 
-        deltainfo = deltacomputer.finddeltainfo(revinfo, fh)
+        deltainfo = deltacomputer.finddeltainfo(revinfo)
 
         compression_mode = COMP_MODE_INLINE
         if self._docket is not None:
@@ -2738,7 +2733,7 @@
         rawtext = btext[0]
 
         if alwayscache and rawtext is None:
-            rawtext = deltacomputer.buildtext(revinfo, fh)
+            rawtext = deltacomputer.buildtext(revinfo)
 
         if type(rawtext) == bytes:  # only accept immutable objects
             self._revisioncache = (node, curr, rawtext)