mercurial/store.py
changeset 51547 8e2a68e10f5c
parent 50929 18c8c18993f0
child 51552 49faa72b994e
equal deleted inserted replaced
51546:f376c4d5c4b6 51547:8e2a68e10f5c
   451                 self._file_size = vfs.stat(self.unencoded_path).st_size
   451                 self._file_size = vfs.stat(self.unencoded_path).st_size
   452             except FileNotFoundError:
   452             except FileNotFoundError:
   453                 self._file_size = 0
   453                 self._file_size = 0
   454         return self._file_size
   454         return self._file_size
   455 
   455 
       
   456     @property
       
   457     def has_size(self):
       
   458         return self._file_size is not None
       
   459 
   456     def get_stream(self, vfs, copies):
   460     def get_stream(self, vfs, copies):
   457         """return data "stream" information for this file
   461         """return data "stream" information for this file
   458 
   462 
   459         (unencoded_file_path, content_iterator, content_size)
   463         (unencoded_file_path, content_iterator, content_size)
   460         """
   464         """
   599         vfs=None,
   603         vfs=None,
   600         copies=None,
   604         copies=None,
   601         max_changeset=None,
   605         max_changeset=None,
   602         preserve_file_count=False,
   606         preserve_file_count=False,
   603     ):
   607     ):
   604         if (
   608         pre_sized = all(f.has_size for f in self.files())
       
   609         if pre_sized and (
   605             repo is None
   610             repo is None
   606             or max_changeset is None
   611             or max_changeset is None
   607             # This use revlog-v2, ignore for now
   612             # This use revlog-v2, ignore for now
   608             or any(k.endswith(b'.idx') for k in self._details.keys())
   613             or any(k.endswith(b'.idx') for k in self._details.keys())
   609             # This is not inline, no race expected
   614             # This is not inline, no race expected