repoview: do not include filter name in name of proxy class
authorYuya Nishihara <yuya@tcha.org>
Tue, 05 Dec 2017 21:37:30 +0900
changeset 40930 9ce4e01f58ee04d754c9d0dc6887492d2ce37c15
parent 40929 d73ccc63b8f9802f105f24d5c55275b23fd0200e
child 40931 c752fbe228fb5fb5338b4b90efcfed7c2046ef7b
push id615
push usergszorc@mozilla.com
push dateFri, 08 Dec 2017 00:11:22 +0000
repoview: do not include filter name in name of proxy class The type object is shared across all filters. I'll add __repr__() instead.
mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -683,21 +683,20 @@ class localrepository(object):
         # Python <3.4 easily leaks types via __mro__. See
         # https://bugs.python.org/issue17950. We cache dynamically
         # created types so this method doesn't leak on every
         # invocation.
 
         key = self.unfiltered().__class__
         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)
-            cls = type(r'%sfilteredrepo' % name, bases, {})
-            self._filteredrepotypes[key] = cls
+            # class of this repo.
+            class filteredrepo(repoview.repoview, key):
+                pass
+            self._filteredrepotypes[key] = filteredrepo
 
         return self._filteredrepotypes[key](self, name)
 
     @repofilecache('bookmarks', 'bookmarks.current')
     def _bookmarks(self):
         return bookmarks.bmstore(self)
 
     @property