Comments
Patch
@@ -466,6 +466,21 @@ class immutablelocalrepository(object):
def _writerequirements(self):
scmutil.writerequires(self.vfs, self.requirements)
+ def unfiltered(self):
+ """Return unfiltered version of the repository
+
+ Intended to be overwritten by filtered repo."""
+ return self
+
+ def filtered(self, name):
+ """Return a filtered version of a repository"""
+ # build a new class with the mixin and the current class
+ # (possibly subclass of the repo)
+ base = self.unfiltered().__class__
+ class filteredrepo(repoview.immutablerepoview, base):
+ pass
+ return filteredrepo(self, name)
+
class localrepository(immutablelocalrepository):
def __init__(self, baseui, path, create=False):
@@ -508,16 +523,7 @@ class localrepository(immutablelocalrepo
def peer(self):
return localpeer(self) # not cached to avoid reference cycle
- def unfiltered(self):
- """Return unfiltered version of the repository
-
- Intended to be overwritten by filtered repo."""
- return self
-
def filtered(self, name):
- """Return a filtered version of a repository"""
- # build a new class with the mixin and the current class
- # (possibly subclass of the repo)
class filteredrepo(repoview.repoview, self.unfiltered().__class__):
pass
return filteredrepo(self, name)