mercurial/repoview.py
changeset 18644 3e92772d5383
parent 18495 8260fa9f30b9
child 18917 fafe9ca2a749
child 18919 cdf764a2f7a5
equal deleted inserted replaced
18643:cc28a84db8c9 18644:3e92772d5383
   147     leads to the property below.
   147     leads to the property below.
   148 
   148 
   149         repoview.method() --> repo.__class__.method(repoview)
   149         repoview.method() --> repo.__class__.method(repoview)
   150 
   150 
   151     The inheritance has to be done dynamically because `repo` can be of any
   151     The inheritance has to be done dynamically because `repo` can be of any
   152     subclasses of `localrepo`. Eg: `bundlerepo` or `httprepo`.
   152     subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`.
   153     """
   153     """
   154 
   154 
   155     def __init__(self, repo, filtername):
   155     def __init__(self, repo, filtername):
   156         object.__setattr__(self, '_unfilteredrepo', repo)
   156         object.__setattr__(self, '_unfilteredrepo', repo)
   157         object.__setattr__(self, 'filtername', filtername)
   157         object.__setattr__(self, 'filtername', filtername)
   158         object.__setattr__(self, '_clcachekey', None)
   158         object.__setattr__(self, '_clcachekey', None)
   159         object.__setattr__(self, '_clcache', None)
   159         object.__setattr__(self, '_clcache', None)
   160 
   160 
   161     # not a cacheproperty on purpose we shall implement a proper cache later
   161     # not a propertycache on purpose we shall implement a proper cache later
   162     @property
   162     @property
   163     def changelog(self):
   163     def changelog(self):
   164         """return a filtered version of the changeset
   164         """return a filtered version of the changeset
   165 
   165 
   166         this changelog must not be used for writing"""
   166         this changelog must not be used for writing"""
   208         return setattr(self._unfilteredrepo, attr, value)
   208         return setattr(self._unfilteredrepo, attr, value)
   209 
   209 
   210     def __delattr__(self, attr):
   210     def __delattr__(self, attr):
   211         return delattr(self._unfilteredrepo, attr)
   211         return delattr(self._unfilteredrepo, attr)
   212 
   212 
   213     # The `requirement` attribut is initialiazed during __init__. But
   213     # The `requirements` attribute is initialized during __init__. But
   214     # __getattr__ won't be called as it also exists on the class. We need
   214     # __getattr__ won't be called as it also exists on the class. We need
   215     # explicit forwarding to main repo here
   215     # explicit forwarding to main repo here
   216     @property
   216     @property
   217     def requirements(self):
   217     def requirements(self):
   218         return self._unfilteredrepo.requirements
   218         return self._unfilteredrepo.requirements