changeset 51585:8e2a68e10f5c

stream: in v3, skip the "size" fast path if the entries as some unknown size We are about to prefetch size during the lock less in the v3 case. So we need to avoid trying to use that prefetched size when it is not available. See next changeset for the motivation.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 26 Mar 2024 18:55:40 +0000
parents f376c4d5c4b6
children 1b17eeba9deb
files mercurial/store.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/store.py	Tue Mar 26 08:43:20 2024 +0000
+++ b/mercurial/store.py	Tue Mar 26 18:55:40 2024 +0000
@@ -453,6 +453,10 @@
                 self._file_size = 0
         return self._file_size
 
+    @property
+    def has_size(self):
+        return self._file_size is not None
+
     def get_stream(self, vfs, copies):
         """return data "stream" information for this file
 
@@ -601,7 +605,8 @@
         max_changeset=None,
         preserve_file_count=False,
     ):
-        if (
+        pre_sized = all(f.has_size for f in self.files())
+        if pre_sized and (
             repo is None
             or max_changeset is None
             # This use revlog-v2, ignore for now