Patchwork D5563: revlog: inline opener options logic into _loadindex()

login
register
mail settings
Submitter phabricator
Date Jan. 13, 2019, 3:28 a.m.
Message ID <f3ed9ce46cb54b1b906a6ea1debcc3a4@localhost.localdomain>
Download mbox | patch
Permalink /patch/37698/
State Not Applicable
Headers show

Comments

phabricator - Jan. 13, 2019, 3:28 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe3cfe0702eac: revlog: inline opener options logic into _loadindex() (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5563?vs=13159&id=13195

REVISION DETAIL
  https://phab.mercurial-scm.org/D5563

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -384,8 +384,11 @@ 
         # 2-tuple of file handles being used for active writing.
         self._writinghandles = None
 
+        self._loadindex()
+
+    def _loadindex(self):
         mmapindexthreshold = None
-        opts = getattr(opener, 'options', {}) or {}
+        opts = getattr(self.opener, 'options', {}) or {}
 
         if 'revlogv2' in opts:
             versionflags = REVLOGV2 | FLAG_INLINE_DATA
@@ -431,9 +434,6 @@ 
             raise error.RevlogError(_('revlog chunk cache size %r is not a '
                                       'power of 2') % self._chunkcachesize)
 
-        self._loadindex(versionflags, mmapindexthreshold)
-
-    def _loadindex(self, versionflags, mmapindexthreshold):
         indexdata = ''
         self._initempty = True
         try:
@@ -2499,7 +2499,7 @@ 
             self.opener.rename(newrl.datafile, self.datafile)
 
         self.clearcaches()
-        self._loadindex(self.version, None)
+        self._loadindex()
 
     def verifyintegrity(self, state):
         """Verifies the integrity of the revlog.