comparison 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
comparison
equal deleted inserted replaced
19845:a1237a4b437d 19846:9789670992d6
32 access: 9 32 access: 9
33 calllog: [0, 7, 9] 33 calllog: [0, 7, 9]
34 cached value (unfiltered): 0 34 cached value (unfiltered): 0
35 cached value ("visible" view): 7 35 cached value ("visible" view): 7
36 cached value ("immutable" view): 9 36 cached value ("immutable" view): 9
37
38
39 === unfiltered property cache ===
40
41 unficalllog: []
42 cached value (unfiltered): NOCACHE
43 cached value ("visible" view): NOCACHE
44 cached value ("immutable" view): NOCACHE
45
46 = first access on unfiltered, should do a call
47 access (unfiltered): 100
48 unficalllog: [100]
49 cached value (unfiltered): 100
50
51 = second access on unfiltered, should not do call
52 access (unfiltered): 100
53 unficalllog: [100]
54 cached value (unfiltered): 100
55
56 = access on view should use the unfiltered cache
57 access (unfiltered): 100
58 access ("visible" view): 100
59 access ("immutable" view): 100
60 unficalllog: [100]
61 cached value (unfiltered): 100
62 cached value ("visible" view): NOCACHE
63 cached value ("immutable" view): NOCACHE
64
65 = even if we clear the unfiltered cache
66 cached value (unfiltered): NOCACHE
67 cached value ("visible" view): NOCACHE
68 cached value ("immutable" view): NOCACHE
69 unficalllog: [100]
70 access ("visible" view): 100
71 unficalllog: [100, 100]
72 cached value (unfiltered): 100
73 cached value ("visible" view): NOCACHE
74 cached value ("immutable" view): NOCACHE
75 access ("immutable" view): 100
76 unficalllog: [100, 100]
77 cached value (unfiltered): 100
78 cached value ("visible" view): NOCACHE
79 cached value ("immutable" view): NOCACHE
80 access (unfiltered): 100
81 unficalllog: [100, 100]
82 cached value (unfiltered): 100
83 cached value ("visible" view): NOCACHE
84 cached value ("immutable" view): NOCACHE