##// END OF EJS Templates
revlog: split the option initialisation in its own method...
marmoute -
r47915:b6e1fe7a default
parent child Browse files
Show More
@@ -363,7 +363,22 b' class revlog(object):'
363 363
364 364 self._concurrencychecker = concurrencychecker
365 365
366 def _loadindex(self):
366 def _init_opts(self):
367 """process options (from above/config) to setup associated default revlog mode
368
369 These values might be affected when actually reading on disk information.
370
371 The relevant values are returned for use in _loadindex().
372
373 * newversionflags:
374 version header to use if we need to create a new revlog
375
376 * mmapindexthreshold:
377 minimal index size for start to use mmap
378
379 * force_nodemap:
380 force the usage of a "development" version of the nodemap code
381 """
367 382 mmapindexthreshold = None
368 383 opts = self.opener.options
369 384
@@ -426,7 +441,12 b' class revlog(object):'
426 441 _(b'revlog chunk cache size %r is not a power of 2')
427 442 % self._chunkcachesize
428 443 )
429
444 force_nodemap = opts.get(b'devel-force-nodemap', False)
445 return newversionflags, mmapindexthreshold, force_nodemap
446
447 def _loadindex(self):
448
449 newversionflags, mmapindexthreshold, force_nodemap = self._init_opts()
430 450 indexdata = b''
431 451 self._initempty = True
432 452 try:
@@ -505,7 +525,7 b' class revlog(object):'
505 525
506 526 devel_nodemap = (
507 527 self.nodemap_file
508 and opts.get(b'devel-force-nodemap', False)
528 and force_nodemap
509 529 and parse_index_v1_nodemap is not None
510 530 )
511 531
General Comments 0
You need to be logged in to leave comments. Login now