Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 19635:b9b7dc267e9f
localrepo: get value from the unfiltered caches should check if the attribute existed.
If the attribute existed already, it should be returned by getattr().
Otherwise, it will be evaluated again.
author | Wei, Elson <elson.wei@gmail.com> |
---|---|
date | Wed, 07 Aug 2013 09:59:45 +0800 |
parents | 00140039bd8f |
children | 36f48c7d5944 |
comparison
equal
deleted
inserted
replaced
19634:49a068b8fb0c | 19635:b9b7dc267e9f |
---|---|
37 | 37 |
38 class unfilteredpropertycache(propertycache): | 38 class unfilteredpropertycache(propertycache): |
39 """propertycache that apply to unfiltered repo only""" | 39 """propertycache that apply to unfiltered repo only""" |
40 | 40 |
41 def __get__(self, repo, type=None): | 41 def __get__(self, repo, type=None): |
42 if hasunfilteredcache(repo, self.name): | |
43 return getattr(repo.unfiltered(), self.name) | |
42 return super(unfilteredpropertycache, self).__get__(repo.unfiltered()) | 44 return super(unfilteredpropertycache, self).__get__(repo.unfiltered()) |
43 | 45 |
44 class filteredpropertycache(propertycache): | 46 class filteredpropertycache(propertycache): |
45 """propertycache that must take filtering in account""" | 47 """propertycache that must take filtering in account""" |
46 | 48 |