Comments
Patch
@@ -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'))
@@ -327,6 +327,7 @@
self.audit = (lambda path, mode=None: True)
self.createmode = None
self._trustnlink = None
+ self.options = {}
@util.propertycache
def _cansymlink(self):
@@ -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'):
@@ -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:
# If options provided but no 'revlog*' found, the repository
# would have no 'requires' file in it, which means we have to
# stick to the old format.
@@ -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()