diff --git a/contrib/dumprevlog b/contrib/dumprevlog
index 188476e48f51055e4c35209cc72b16622c6e14e1_Y29udHJpYi9kdW1wcmV2bG9n..3518da5043032c41ade95e9e6832059e815abbbb_Y29udHJpYi9kdW1wcmV2bG9n 100755
--- a/contrib/dumprevlog
+++ b/contrib/dumprevlog
@@ -22,6 +22,7 @@
     if b'b' not in mode:
         mode = mode + b'b'
     return open(path, pycompat.sysstr(mode))
+binopen.options = {}
 
 def printb(data, end=b'\n'):
     sys.stdout.flush()
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
index 188476e48f51055e4c35209cc72b16622c6e14e1_bWVyY3VyaWFsL3JldmxvZy5weQ==..3518da5043032c41ade95e9e6832059e815abbbb_bWVyY3VyaWFsL3JldmxvZy5weQ== 100644
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -355,7 +355,7 @@
 
     def _loadindex(self):
         mmapindexthreshold = None
-        opts = getattr(self.opener, 'options', {}) or {}
+        opts = self.opener.options
 
         if 'revlogv2' in opts:
             newversionflags = REVLOGV2 | FLAG_INLINE_DATA
@@ -363,7 +363,7 @@
             newversionflags = REVLOGV1 | FLAG_INLINE_DATA
             if 'generaldelta' in opts:
                 newversionflags |= FLAG_GENERALDELTA
-        elif 'revlogv0' in getattr(self.opener, 'options', {}):
+        elif 'revlogv0' in self.opener.options:
             newversionflags = REVLOGV0
         else:
             newversionflags = REVLOG_DEFAULT_VERSION
diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
index 188476e48f51055e4c35209cc72b16622c6e14e1_bWVyY3VyaWFsL3N0YXRpY2h0dHByZXBvLnB5..3518da5043032c41ade95e9e6832059e815abbbb_bWVyY3VyaWFsL3N0YXRpY2h0dHByZXBvLnB5 100644
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -115,6 +115,7 @@
     class statichttpvfs(vfsmod.abstractvfs):
         def __init__(self, base):
             self.base = base
+            self.options = {}
 
         def __call__(self, path, mode='r', *args, **kw):
             if mode not in ('r', 'rb'):
diff --git a/mercurial/vfs.py b/mercurial/vfs.py
index 188476e48f51055e4c35209cc72b16622c6e14e1_bWVyY3VyaWFsL3Zmcy5weQ==..3518da5043032c41ade95e9e6832059e815abbbb_bWVyY3VyaWFsL3Zmcy5weQ== 100644
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -327,6 +327,7 @@
             self.audit = (lambda path, mode=None: True)
         self.createmode = None
         self._trustnlink = None
+        self.options = {}
 
     @util.propertycache
     def _cansymlink(self):
diff --git a/tests/test-parseindex.t b/tests/test-parseindex.t
index 188476e48f51055e4c35209cc72b16622c6e14e1_dGVzdHMvdGVzdC1wYXJzZWluZGV4LnQ=..3518da5043032c41ade95e9e6832059e815abbbb_dGVzdHMvdGVzdC1wYXJzZWluZGV4LnQ= 100644
--- a/tests/test-parseindex.t
+++ b/tests/test-parseindex.t
@@ -53,6 +53,7 @@
   >     def wrapper(*a, **kwargs):
   >         f = o(*a, **kwargs)
   >         return singlebyteread(f)
+  >     wrapper.options = o.options
   >     return wrapper
   > 
   > cl = changelog.changelog(opener(b'.hg/store'))