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

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 5, 2017, 1:40 p.m.
Message ID <ac2f7bb76d318b3f32d8.1512481234@mimosa>
Download mbox | patch
Permalink /patch/25937/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 5, 2017, 1:40 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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.

Patch

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)