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