comparison mercurial/revlog.py @ 44308:5962fd0d1045

nodemap: write nodemap data on disk Let us start writing data on disk (so that we can read it from there later). This series of changeset is going to focus first on having data on disk and updating it. Right now the data is written right next to the revlog data, in the store. We might move it to cache (with proper cache validation mechanism) later, but for now revlog have a storevfs instance and it is simpler to us it. The right location for this data is not the focus of this series. Differential Revision: https://phab.mercurial-scm.org/D7835
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Jan 2020 15:47:21 +0100
parents b9e174d4ed11
children daad3aace942
comparison
equal deleted inserted replaced
44307:c577bb4a04d4 44308:5962fd0d1045
405 datafile=None, 405 datafile=None,
406 checkambig=False, 406 checkambig=False,
407 mmaplargeindex=False, 407 mmaplargeindex=False,
408 censorable=False, 408 censorable=False,
409 upperboundcomp=None, 409 upperboundcomp=None,
410 persistentnodemap=False,
410 ): 411 ):
411 """ 412 """
412 create a revlog object 413 create a revlog object
413 414
414 opener is a function that abstracts the file opening operation 415 opener is a function that abstracts the file opening operation
416 417
417 """ 418 """
418 self.upperboundcomp = upperboundcomp 419 self.upperboundcomp = upperboundcomp
419 self.indexfile = indexfile 420 self.indexfile = indexfile
420 self.datafile = datafile or (indexfile[:-2] + b".d") 421 self.datafile = datafile or (indexfile[:-2] + b".d")
422 self.nodemap_file = None
423 if persistentnodemap:
424 self.nodemap_file = indexfile[:-2] + b".n"
425
421 self.opener = opener 426 self.opener = opener
422 # When True, indexfile is opened with checkambig=True at writing, to 427 # When True, indexfile is opened with checkambig=True at writing, to
423 # avoid file stat ambiguity. 428 # avoid file stat ambiguity.
424 self._checkambig = checkambig 429 self._checkambig = checkambig
425 self._mmaplargeindex = mmaplargeindex 430 self._mmaplargeindex = mmaplargeindex
2284 transaction.add(self.indexfile, offset, curr) 2289 transaction.add(self.indexfile, offset, curr)
2285 ifh.write(entry) 2290 ifh.write(entry)
2286 ifh.write(data[0]) 2291 ifh.write(data[0])
2287 ifh.write(data[1]) 2292 ifh.write(data[1])
2288 self._enforceinlinesize(transaction, ifh) 2293 self._enforceinlinesize(transaction, ifh)
2294 nodemaputil.setup_persistent_nodemap(transaction, self)
2289 2295
2290 def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None): 2296 def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None):
2291 """ 2297 """
2292 add a delta group 2298 add a delta group
2293 2299