##// END OF EJS Templates
revlog: always process opener options...
Gregory Szorc -
r41236:cecf3f8b default
parent child Browse files
Show More
@@ -384,44 +384,45 b' class revlog(object):'
384 384 self._writinghandles = None
385 385
386 386 mmapindexthreshold = None
387 v = REVLOG_DEFAULT_VERSION
388 opts = getattr(opener, 'options', None)
389 if opts is not None:
390 if 'revlogv2' in opts:
391 # version 2 revlogs always use generaldelta.
392 v = REVLOGV2 | FLAG_GENERALDELTA | FLAG_INLINE_DATA
393 elif 'revlogv1' in opts:
394 if 'generaldelta' in opts:
395 v |= FLAG_GENERALDELTA
396 else:
397 v = 0
398 if 'chunkcachesize' in opts:
399 self._chunkcachesize = opts['chunkcachesize']
400 if 'maxchainlen' in opts:
401 self._maxchainlen = opts['maxchainlen']
402 if 'deltabothparents' in opts:
403 self._deltabothparents = opts['deltabothparents']
404 self._lazydeltabase = bool(opts.get('lazydeltabase', False))
405 if 'compengine' in opts:
406 self._compengine = opts['compengine']
407 if 'maxdeltachainspan' in opts:
408 self._maxdeltachainspan = opts['maxdeltachainspan']
409 if mmaplargeindex and 'mmapindexthreshold' in opts:
410 mmapindexthreshold = opts['mmapindexthreshold']
411 self._sparserevlog = bool(opts.get('sparse-revlog', False))
412 withsparseread = bool(opts.get('with-sparse-read', False))
413 # sparse-revlog forces sparse-read
414 self._withsparseread = self._sparserevlog or withsparseread
415 if 'sparse-read-density-threshold' in opts:
416 self._srdensitythreshold = opts['sparse-read-density-threshold']
417 if 'sparse-read-min-gap-size' in opts:
418 self._srmingapsize = opts['sparse-read-min-gap-size']
419 if opts.get('enableellipsis'):
420 self._flagprocessors[REVIDX_ELLIPSIS] = ellipsisprocessor
421
422 # revlog v0 doesn't have flag processors
423 for flag, processor in opts.get(b'flagprocessors', {}).iteritems():
424 _insertflagprocessor(flag, processor, self._flagprocessors)
387 opts = getattr(opener, 'options', {}) or {}
388
389 if 'revlogv2' in opts:
390 # version 2 revlogs always use generaldelta.
391 v = REVLOGV2 | FLAG_GENERALDELTA | FLAG_INLINE_DATA
392 elif 'revlogv1' in opts:
393 v = REVLOGV1 | FLAG_INLINE_DATA
394 if 'generaldelta' in opts:
395 v |= FLAG_GENERALDELTA
396 else:
397 v = REVLOG_DEFAULT_VERSION
398
399 if 'chunkcachesize' in opts:
400 self._chunkcachesize = opts['chunkcachesize']
401 if 'maxchainlen' in opts:
402 self._maxchainlen = opts['maxchainlen']
403 if 'deltabothparents' in opts:
404 self._deltabothparents = opts['deltabothparents']
405 self._lazydeltabase = bool(opts.get('lazydeltabase', False))
406 if 'compengine' in opts:
407 self._compengine = opts['compengine']
408 if 'maxdeltachainspan' in opts:
409 self._maxdeltachainspan = opts['maxdeltachainspan']
410 if mmaplargeindex and 'mmapindexthreshold' in opts:
411 mmapindexthreshold = opts['mmapindexthreshold']
412 self._sparserevlog = bool(opts.get('sparse-revlog', False))
413 withsparseread = bool(opts.get('with-sparse-read', False))
414 # sparse-revlog forces sparse-read
415 self._withsparseread = self._sparserevlog or withsparseread
416 if 'sparse-read-density-threshold' in opts:
417 self._srdensitythreshold = opts['sparse-read-density-threshold']
418 if 'sparse-read-min-gap-size' in opts:
419 self._srmingapsize = opts['sparse-read-min-gap-size']
420 if opts.get('enableellipsis'):
421 self._flagprocessors[REVIDX_ELLIPSIS] = ellipsisprocessor
422
423 # revlog v0 doesn't have flag processors
424 for flag, processor in opts.get(b'flagprocessors', {}).iteritems():
425 _insertflagprocessor(flag, processor, self._flagprocessors)
425 426
426 427 if self._chunkcachesize <= 0:
427 428 raise error.RevlogError(_('revlog chunk cache size %r is not '
General Comments 0
You need to be logged in to leave comments. Login now