[PATCH 04 of 10] branchmap: add the tiprev (cache key) on the branchmap object
Augie Fackler
raf at durin42.com
Sun Dec 23 19:33:51 CST 2012
On Dec 23, 2012, at 8:32 PM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
>
> On 24 déc. 2012, at 02:21, Augie Fackler wrote:
>
>>
>> On Dec 21, 2012, at 8:48 PM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
>>
>>> # HG changeset patch
>>> # User Pierre-Yves David <pierre-yves.david at logilab.fr>
>>> # Date 1356138386 -3600
>>> # Node ID 090ada0acddb4486e94fba9c89e25b0624442d0f
>>> # Parent ad194a8ab5c15e6d74fe087061ee960f5d6bbf16
>>> branchmap: add the tiprev (cache key) on the branchmap object
>>>
>>> The actual cache key used on disk is the (tipnode, tiprev) pair. There is no
>>> reason not to use the revision number for the in memory version.
>>
>> It feels strange to me to have both tipnode and tiprev on this object, partially because it feels more likely that they'll fall out of sync somehow. Then again, I suppose if that happens then we want the cache to be invalidated anyway?
>
> They are both part of the key so we better have both of them here.
>
> Patch 8 removes any all updates mades outside the class lowering the chance for them to go out of sync by mistake
>
> Patch 10 makes a heavy use of both to check validity of a cache again a repo state. In particular, we read and write both on disk.
Is there any reason code outside of the branchmap class should ever be peeking at these attributes? Could I persuade you to make them private in a followup?
>
> --
> Pierre-Yves David
>
More information about the Mercurial-devel
mailing list