comparison mercurial/revlog.py @ 41203:d0de4fdd87aa

revlog: store mmaplargeindex as an instance attribute This makes it more consistent with everything else. It also makes it possible to move the opener/features processing into _loadindex(). Differential Revision: https://phab.mercurial-scm.org/D5562
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 09 Jan 2019 16:14:09 -0800
parents e7a2cc84dbc0
children e3cfe0702eac
comparison
equal deleted inserted replaced
41202:e7a2cc84dbc0 41203:d0de4fdd87aa
350 self.datafile = datafile or (indexfile[:-2] + ".d") 350 self.datafile = datafile or (indexfile[:-2] + ".d")
351 self.opener = opener 351 self.opener = opener
352 # When True, indexfile is opened with checkambig=True at writing, to 352 # When True, indexfile is opened with checkambig=True at writing, to
353 # avoid file stat ambiguity. 353 # avoid file stat ambiguity.
354 self._checkambig = checkambig 354 self._checkambig = checkambig
355 self._mmaplargeindex = mmaplargeindex
355 self._censorable = censorable 356 self._censorable = censorable
356 # 3-tuple of (node, rev, text) for a raw revision. 357 # 3-tuple of (node, rev, text) for a raw revision.
357 self._revisioncache = None 358 self._revisioncache = None
358 # Maps rev to chain base rev. 359 # Maps rev to chain base rev.
359 self._chainbasecache = util.lrucachedict(100) 360 self._chainbasecache = util.lrucachedict(100)
404 self._lazydeltabase = bool(opts.get('lazydeltabase', False)) 405 self._lazydeltabase = bool(opts.get('lazydeltabase', False))
405 if 'compengine' in opts: 406 if 'compengine' in opts:
406 self._compengine = opts['compengine'] 407 self._compengine = opts['compengine']
407 if 'maxdeltachainspan' in opts: 408 if 'maxdeltachainspan' in opts:
408 self._maxdeltachainspan = opts['maxdeltachainspan'] 409 self._maxdeltachainspan = opts['maxdeltachainspan']
409 if mmaplargeindex and 'mmapindexthreshold' in opts: 410 if self._mmaplargeindex and 'mmapindexthreshold' in opts:
410 mmapindexthreshold = opts['mmapindexthreshold'] 411 mmapindexthreshold = opts['mmapindexthreshold']
411 self._sparserevlog = bool(opts.get('sparse-revlog', False)) 412 self._sparserevlog = bool(opts.get('sparse-revlog', False))
412 withsparseread = bool(opts.get('with-sparse-read', False)) 413 withsparseread = bool(opts.get('with-sparse-read', False))
413 # sparse-revlog forces sparse-read 414 # sparse-revlog forces sparse-read
414 self._withsparseread = self._sparserevlog or withsparseread 415 self._withsparseread = self._sparserevlog or withsparseread