vfs: fix proxyvfs inheritance
authorBoris Feld <boris.feld@octobus.net>
Wed, 02 Jan 2019 10:29:12 +0100
changeset 41093 6498f0e03526
parent 41092 9e593db5f1a1
child 41094 adee334d94cd
vfs: fix proxyvfs inheritance The proxyvfs class is designed to overwrite some of the vfs logic. Yet, it did not use normal class inheritance. This is becoming an issue as `abstractvfs` method could take precedence over their `proxyvfs` version. We fix the inheritance chain to be as expected.
mercurial/store.py
mercurial/vfs.py
--- a/mercurial/store.py	Wed Dec 26 13:44:37 2018 +0100
+++ b/mercurial/store.py	Wed Jan 02 10:29:12 2019 +0100
@@ -523,7 +523,7 @@
             self._load()
         return iter(self.entries | self.addls)
 
-class _fncachevfs(vfsmod.abstractvfs, vfsmod.proxyvfs):
+class _fncachevfs(vfsmod.proxyvfs):
     def __init__(self, vfs, fnc, encode):
         vfsmod.proxyvfs.__init__(self, vfs)
         self.fncache = fnc
--- a/mercurial/vfs.py	Wed Dec 26 13:44:37 2018 +0100
+++ b/mercurial/vfs.py	Wed Jan 02 10:29:12 2019 +0100
@@ -469,7 +469,7 @@
 
 opener = vfs
 
-class proxyvfs(object):
+class proxyvfs(abstractvfs):
     def __init__(self, vfs):
         self.vfs = vfs
 
@@ -481,7 +481,7 @@
     def options(self, value):
         self.vfs.options = value
 
-class filtervfs(abstractvfs, proxyvfs):
+class filtervfs(proxyvfs, abstractvfs):
     '''Wrapper vfs for filtering filenames with a function.'''
 
     def __init__(self, vfs, filter):
@@ -499,7 +499,7 @@
 
 filteropener = filtervfs
 
-class readonlyvfs(abstractvfs, proxyvfs):
+class readonlyvfs(proxyvfs):
     '''Wrapper vfs preventing any writing.'''
 
     def __init__(self, vfs):