diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -503,7 +503,7 @@ self._postdsstatus = [] # Cache of types representing filtered repos. - self._filteredrepotypes = weakref.WeakKeyDictionary() + self._filteredrepotypes = weakref.WeakValueDictionary() # generic mapping between names and nodes self.names = namespaces.namespaces() @@ -685,12 +685,13 @@ # created types so this method doesn't leak on every # invocation. - key = self.unfiltered().__class__ + unfibase = self.unfiltered().__class__ + key = str(self.unfiltered().__class__) + name if key not in self._filteredrepotypes: # Build a new type with the repoview mixin and the base # class of this repo. Give it a name containing the # filter name to aid debugging. - bases = (repoview.repoview, key) + bases = (repoview.repoview, unfibase) cls = type(r'%sfilteredrepo' % name, bases, {}) self._filteredrepotypes[key] = cls