Commit Graph

9 Commits

Author SHA1 Message Date
Yuya Nishihara
e9c97cfd36 tests: import mercurial modules by name in test-propertycache
This is our convention, and silences import-checker.py that would say
imports weren't lexically sorted.
2016-04-05 23:30:18 +09:00
Yuya Nishihara
c2a5918b06 tests: remove unused import of mercurial.repoview from test-propertycache
I don't see any reason to import it, but if there is a reason, please disregard
this and the next patch.
2016-04-05 23:33:55 +09:00
Robert Stanca
09fc340580 py3: use print_function in test-propertycache.py 2016-04-04 04:56:05 +03:00
Robert Stanca
6fd5d912b0 py3: use absolute_import in test-propertycache.py 2016-04-04 03:16:18 +03:00
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Mads Kiilerich
eabc047878 spelling: random spell checker fixes 2013-10-24 01:49:56 +08:00
Pierre-Yves David
bcf260ff40 test: make test-propertycache.py python2.4 compatible
The subprocess module have not `check_call` method in python2.4. Fall back to
calling `check` with return code verification.
2013-10-02 11:16:03 +02:00
Pierre-Yves David
763949e575 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.
2013-09-30 14:23:14 +02:00
Pierre-Yves David
a411302ece 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.
2013-09-30 14:36:11 +02:00