Mercurial > public > mercurial-scm > hg
diff tests/test-propertycache.py.out @ 19845:a1237a4b437d stable
repoview: make propertycache.setcache compatible with repoview
Propertycache used standard attribute assignment. In the repoview case, this
assignment was forwarded to the unfiltered repo. This result in:
(1) unfiltered repo got a potentially wrong cache value,
(2) repoview never reused the cached value.
This patch replaces the standard attribute assignment by an assignment to
`objc.__dict__` which will bypass the `repoview.__setattr__`. This will not
affects other `propertycache` users and it is actually closer to the semantic we
need.
The interaction of `propertycache` and `repoview` are now tested in a python
test file.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 30 Sep 2013 14:36:11 +0200 |
parents | |
children | 9789670992d6 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-propertycache.py.out Mon Sep 30 14:36:11 2013 +0200 @@ -0,0 +1,36 @@ + +=== property cache === + +calllog: [] +cached value (unfiltered): NOCACHE + += first access on unfiltered, should do a call +access: 0 +calllog: [0] +cached value (unfiltered): 0 + += second access on unfiltered, should not do call +access 0 +calllog: [0] +cached value (unfiltered): 0 + += first access on "visible" view, should do a call +cached value ("visible" view): NOCACHE +access: 7 +calllog: [0, 7] +cached value (unfiltered): 0 +cached value ("visible" view): 7 + += second access on "visible view", should not do call +access: 7 +calllog: [0, 7] +cached value (unfiltered): 0 +cached value ("visible" view): 7 + += no effect on other view +cached value ("immutable" view): NOCACHE +access: 9 +calllog: [0, 7, 9] +cached value (unfiltered): 0 +cached value ("visible" view): 7 +cached value ("immutable" view): 9