[PATCH 1 of 2 STABLE] repoview: make propertycache.setcache compatible with repoview

Idan Kamara idankk86 at gmail.com
Tue Oct 1 10:11:22 CDT 2013


On Oct 1, 2013 5:09 PM, "Pierre-Yves David" <pierre-yves.david at ens-lyon.org>
wrote:
>
> On 10/01/2013 01:04 PM, Idan Kamara wrote:
>>
>>
>> On Mon, Sep 30, 2013 at 3:53 PM, <pierre-yves.david at ens-lyon.org> wrote:
>>>
>>> # HG changeset patch
>>> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
>>> # Date 1380544571 -7200
>>> #      Mon Sep 30 14:36:11 2013 +0200
>>> # Branch stable
>>> # Node ID 365d4888627295bb0368d658224cb9900fdcb6f7
>>> # Parent  4d2bea6604d3bfb34860590fbb6e302cbf273f98
>>> 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.
>>
>>
>> Wouldn't this test be a lot more readable as a standard Python unit test?
>
>
> That's not how other pure python test are written.

Because most of them predate the time the testing framework supported unit
tests.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20131001/85c9a06c/attachment.html>


More information about the Mercurial-devel mailing list