##// END OF EJS Templates
revlog: inline opener options logic into _loadindex()...
Gregory Szorc -
r41240:e3cfe070 default
parent child Browse files
Show More
@@ -384,8 +384,11 b' class revlog(object):'
384 # 2-tuple of file handles being used for active writing.
384 # 2-tuple of file handles being used for active writing.
385 self._writinghandles = None
385 self._writinghandles = None
386
386
387 self._loadindex()
388
389 def _loadindex(self):
387 mmapindexthreshold = None
390 mmapindexthreshold = None
388 opts = getattr(opener, 'options', {}) or {}
391 opts = getattr(self.opener, 'options', {}) or {}
389
392
390 if 'revlogv2' in opts:
393 if 'revlogv2' in opts:
391 versionflags = REVLOGV2 | FLAG_INLINE_DATA
394 versionflags = REVLOGV2 | FLAG_INLINE_DATA
@@ -431,9 +434,6 b' class revlog(object):'
431 raise error.RevlogError(_('revlog chunk cache size %r is not a '
434 raise error.RevlogError(_('revlog chunk cache size %r is not a '
432 'power of 2') % self._chunkcachesize)
435 'power of 2') % self._chunkcachesize)
433
436
434 self._loadindex(versionflags, mmapindexthreshold)
435
436 def _loadindex(self, versionflags, mmapindexthreshold):
437 indexdata = ''
437 indexdata = ''
438 self._initempty = True
438 self._initempty = True
439 try:
439 try:
@@ -2499,7 +2499,7 b' class revlog(object):'
2499 self.opener.rename(newrl.datafile, self.datafile)
2499 self.opener.rename(newrl.datafile, self.datafile)
2500
2500
2501 self.clearcaches()
2501 self.clearcaches()
2502 self._loadindex(self.version, None)
2502 self._loadindex()
2503
2503
2504 def verifyintegrity(self, state):
2504 def verifyintegrity(self, state):
2505 """Verifies the integrity of the revlog.
2505 """Verifies the integrity of the revlog.
General Comments 0
You need to be logged in to leave comments. Login now