diff tests/test-propertycache.py.out @ 19846:9789670992d6 stable

repoview: have unfilteredpropertycache using the underlying cache A `unfilteredpropertycache` is a kind of `propertycache` used on `localrepo` to unsure it will always be run against unfiltered repo and stored only once. As the cached value is never stored in the repoview instance, the descriptor will always be called. Before this patch such calls always result in a call to the `__get__` method of the `propertycache` on the unfiltered repo. That was recomputing a new value on every access through a repoview. We can't prevent the repoview's `unfilteredpropertycache` to get called on every access. In that case the new code makes a standard attribute access to the property. If a value is cached it will be used. The `propertycache` test file have been augmented with test about this issue.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 30 Sep 2013 14:23:14 +0200
parents a1237a4b437d
children
line wrap: on
line diff
--- a/tests/test-propertycache.py.out	Mon Sep 30 14:36:11 2013 +0200
+++ b/tests/test-propertycache.py.out	Mon Sep 30 14:23:14 2013 +0200
@@ -34,3 +34,51 @@
 cached value (unfiltered): 0
 cached value ("visible" view): 7
 cached value ("immutable" view): 9
+
+
+=== unfiltered property cache ===
+
+unficalllog: []
+cached value (unfiltered):       NOCACHE
+cached value ("visible" view):   NOCACHE
+cached value ("immutable" view): NOCACHE
+
+= first access on unfiltered, should do a call
+access (unfiltered): 100
+unficalllog: [100]
+cached value (unfiltered):       100
+
+= second access on unfiltered, should not do call
+access (unfiltered): 100
+unficalllog: [100]
+cached value (unfiltered):       100
+
+= access on view should use the unfiltered cache
+access (unfiltered):       100
+access ("visible" view):   100
+access ("immutable" view): 100
+unficalllog: [100]
+cached value (unfiltered):       100
+cached value ("visible" view):   NOCACHE
+cached value ("immutable" view): NOCACHE
+
+= even if we clear the unfiltered cache
+cached value (unfiltered):       NOCACHE
+cached value ("visible" view):   NOCACHE
+cached value ("immutable" view): NOCACHE
+unficalllog: [100]
+access ("visible" view):   100
+unficalllog: [100, 100]
+cached value (unfiltered):       100
+cached value ("visible" view):   NOCACHE
+cached value ("immutable" view): NOCACHE
+access ("immutable" view): 100
+unficalllog: [100, 100]
+cached value (unfiltered):       100
+cached value ("visible" view):   NOCACHE
+cached value ("immutable" view): NOCACHE
+access (unfiltered):       100
+unficalllog: [100, 100]
+cached value (unfiltered):       100
+cached value ("visible" view):   NOCACHE
+cached value ("immutable" view): NOCACHE