mercurial/repoview.py
branchstable
changeset 47009 42eb8b7881b8
parent 46195 d6a9e690d620
child 47010 76ae43d5b1db
equal deleted inserted replaced
47008:77e73827a02d 47009:42eb8b7881b8
   470 _filteredrepotypes = weakref.WeakKeyDictionary()
   470 _filteredrepotypes = weakref.WeakKeyDictionary()
   471 
   471 
   472 
   472 
   473 def newtype(base):
   473 def newtype(base):
   474     """Create a new type with the repoview mixin and the given base class"""
   474     """Create a new type with the repoview mixin and the given base class"""
   475     if base not in _filteredrepotypes:
   475     cls = _filteredrepotypes.get(base)
   476 
   476     if cls is not None:
   477         class filteredrepo(repoview, base):
   477         return cls
   478             pass
   478 
   479 
   479     class filteredrepo(repoview, base):
   480         _filteredrepotypes[base] = filteredrepo
   480         pass
   481     return _filteredrepotypes[base]
   481 
       
   482     _filteredrepotypes[base] = filteredrepo
       
   483     return filteredrepo