[PATCH] localrepo: get value from the unfiltered caches should check if the attribute existed

elson.wei at gmail.com elson.wei at gmail.com
Mon Aug 5 22:45:44 CDT 2013


# HG changeset patch
# User Wei, Elson <elson.wei at gmail.com>
# Date 1375760701 -28800
#      Tue Aug 06 11:45:01 2013 +0800
# Node ID 06e23972c0d2d9420e96dd657db1cc2d30b7fc11
# Parent  a58251c0568fc5e86089a803ca75f75cc8c01678
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.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -39,6 +39,8 @@
     """propertycache that apply to unfiltered repo only"""
 
     def __get__(self, repo, type=None):
+        if hasunfilteredcache(repo, self.name):
+            return getattr(repo.unfiltered(), self.name)
         return super(unfilteredpropertycache, self).__get__(repo.unfiltered())
 
 class filteredpropertycache(propertycache):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2013-08-06_11-35-31_r19526+.diff
Type: text/x-patch
Size: 898 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130806/e87f6ad4/attachment.bin>


More information about the Mercurial-devel mailing list