[PATCH 1 of 3] repoview: do not include filter name in name of proxy class

Yuya Nishihara yuya at tcha.org
Tue Dec 5 13:40:34 UTC 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1512477450 -32400
#      Tue Dec 05 21:37:30 2017 +0900
# Node ID ac2f7bb76d318b3f32d83f4674d99a78bb3ea42b
# Parent  5de6402805efd2451e6853f49098145d3d9d176f
repoview: do not include filter name in name of proxy class

The type object is shared across all filters. I'll add __repr__() instead.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -688,11 +688,10 @@ class localrepository(object):
         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)
 


More information about the Mercurial-devel mailing list