mercurial/repoview.py
branchstable
changeset 47011 b7e623ac98b6
parent 47010 76ae43d5b1db
child 47148 a07d5cb03a85
equal deleted inserted replaced
47010:76ae43d5b1db 47011:b7e623ac98b6
   462 
   462 
   463     def __delattr__(self, attr):
   463     def __delattr__(self, attr):
   464         return delattr(self._unfilteredrepo, attr)
   464         return delattr(self._unfilteredrepo, attr)
   465 
   465 
   466 
   466 
   467 # Python <3.4 easily leaks types via __mro__. See
   467 # Dynamically created classes introduce memory cycles via __mro__. See
   468 # https://bugs.python.org/issue17950. We cache dynamically created types
   468 # https://bugs.python.org/issue17950.
   469 # so they won't be leaked on every invocation of repo.filtered().
   469 # This need of the garbage collector can turn into memory leak in
       
   470 # Python <3.4, which is the first version released with PEP 442.
   470 _filteredrepotypes = weakref.WeakKeyDictionary()
   471 _filteredrepotypes = weakref.WeakKeyDictionary()
   471 
   472 
   472 
   473 
   473 def newtype(base):
   474 def newtype(base):
   474     """Create a new type with the repoview mixin and the given base class"""
   475     """Create a new type with the repoview mixin and the given base class"""