Mercurial > hg
comparison mercurial/statichttprepo.py @ 43025:3518da504303
vfs: give all vfs an options attribute by default
Multiple code path assume vfs have an options attribute, including the vfs module
itself. So for consistency we explicitly add one to all vfs.
This will prevent various crash in the next changesets.
Differential Revision: https://phab.mercurial-scm.org/D6935
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 27 Sep 2019 05:17:30 +0200 |
parents | d345627d104b |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
43024:188476e48f51 | 43025:3518da504303 |
---|---|
113 urlopener.add_handler(_HTTPRangeHandler()) | 113 urlopener.add_handler(_HTTPRangeHandler()) |
114 | 114 |
115 class statichttpvfs(vfsmod.abstractvfs): | 115 class statichttpvfs(vfsmod.abstractvfs): |
116 def __init__(self, base): | 116 def __init__(self, base): |
117 self.base = base | 117 self.base = base |
118 self.options = {} | |
118 | 119 |
119 def __call__(self, path, mode='r', *args, **kw): | 120 def __call__(self, path, mode='r', *args, **kw): |
120 if mode not in ('r', 'rb'): | 121 if mode not in ('r', 'rb'): |
121 raise IOError('Permission denied') | 122 raise IOError('Permission denied') |
122 f = "/".join((self.base, urlreq.quote(path))) | 123 f = "/".join((self.base, urlreq.quote(path))) |