[PATCH] mq: use util.propertycache, introduce method invalidate for mq and repo

Matt Mackall mpm at selenic.com
Sun May 3 15:58:24 CDT 2009


Martin Geisler wrote:
> Simon Heimberg <simohe at besonet.ch> writes:
> 
>> # HG changeset patch
>> # User Simon Heimberg <simohe at besonet.ch>
>> # Date 1241209449 -7200
>> # Node ID ff1d180722e90fb6908b6cb29c067ea1889793cc
>> # Parent  cc8cecb78ddab5a5cd06df68a2e8e334a0100ddd
>> mq: use util.propertycache, introduce method invalidate for mq and repo
>>
[...]
>> +            if a in self.__dict__:
>> +                del self.__dict__[a]
> 
> Would it not be nicer to use hasattr and delattr?

It would be, if only it worked. hasattr attempts to resolve the 
attribute in question through normal means.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list