mercurial/revlog.py
changeset 52176 72bc29f01570
parent 52167 7346f93be7a4
child 52178 bcd4962e0df9
equal deleted inserted replaced
52175:bd43465af568 52176:72bc29f01570
  1791             use_rust_index = True
  1791             use_rust_index = True
  1792 
  1792 
  1793             if self._format_version != REVLOGV1:
  1793             if self._format_version != REVLOGV1:
  1794                 use_rust_index = False
  1794                 use_rust_index = False
  1795 
  1795 
       
  1796         if hasattr(self.opener, "fncache"):
       
  1797             vfs = self.opener.vfs
       
  1798             if not self.opener.uses_dotencode:
       
  1799                 use_rust_index = False
       
  1800             if not isinstance(vfs, vfsmod.vfs):
       
  1801                 # Be cautious since we don't support other vfs
       
  1802                 use_rust_index = False
       
  1803         else:
       
  1804             # Rust only supports repos with fncache
       
  1805             use_rust_index = False
       
  1806 
  1796         self._parse_index = parse_index_v1
  1807         self._parse_index = parse_index_v1
  1797         if self._format_version == REVLOGV0:
  1808         if self._format_version == REVLOGV0:
  1798             self._parse_index = revlogv0.parse_index_v0
  1809             self._parse_index = revlogv0.parse_index_v0
  1799         elif self._format_version == REVLOGV2:
  1810         elif self._format_version == REVLOGV2:
  1800             self._parse_index = parse_index_v2
  1811             self._parse_index = parse_index_v2
  1826             default_compression_header = None
  1837             default_compression_header = None
  1827         else:
  1838         else:
  1828             default_compression_header = self._docket.default_compression_header
  1839             default_compression_header = self._docket.default_compression_header
  1829 
  1840 
  1830         if self.uses_rust:
  1841         if self.uses_rust:
       
  1842             vfs_is_readonly = False
       
  1843             fncache = None
       
  1844 
       
  1845             if hasattr(self.opener, "vfs"):
       
  1846                 vfs = self.opener
       
  1847                 if isinstance(vfs, vfsmod.readonlyvfs):
       
  1848                     vfs_is_readonly = True
       
  1849                     vfs = vfs.vfs
       
  1850                 fncache = vfs.fncache
       
  1851                 vfs = vfs.vfs
       
  1852             else:
       
  1853                 vfs = self.opener
       
  1854 
       
  1855             vfs_base = vfs.base
       
  1856             assert fncache is not None, "Rust only supports repos with fncache"
       
  1857 
  1831             self._inner = rustrevlog.InnerRevlog(
  1858             self._inner = rustrevlog.InnerRevlog(
  1832                 opener=RustVFSWrapper(self.opener),
  1859                 vfs_base=vfs_base,
       
  1860                 fncache=fncache,
       
  1861                 vfs_is_readonly=vfs_is_readonly,
  1833                 index_data=index,
  1862                 index_data=index,
  1834                 index_file=self._indexfile,
  1863                 index_file=self._indexfile,
  1835                 data_file=self._datafile,
  1864                 data_file=self._datafile,
  1836                 sidedata_file=self._sidedatafile,
  1865                 sidedata_file=self._sidedatafile,
  1837                 inline=self._inline,
  1866                 inline=self._inline,