[PATCH 3 of 9] branchmap: takes filtered revision in account for cache calculation
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Fri Dec 28 00:37:52 UTC 2012
On 27 déc. 2012, at 17:49, Kevin Bullock wrote:
> On Dec 26, 2012, at 2:32 PM, Pierre-Yves David wrote:
>
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
>> # Date 1356276302 -3600
>> # Node ID 4b098d0339f9e8b1805c4f6ef1d8bcf59f5a6349
>> # Parent fbf90f3d261f274c1e690026c1a95fd787d3facc
>> branchmap: takes filtered revision in account for cache calculation
>>
>> Tracking tipnode and tiprev is not enough to ensure validaty of the cache as
>> they do not help to distinct cache that ignored various revision bellow tip rev.
> help distinguish a cache that revisions below
>>
>> To detect such difference, we build a cache of all revision ignored. This hash
> hash? ignored revisions.
>> is then used when checking validity of a cache for a repo.
> checking the validity of
>
>> diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
>> --- a/mercurial/branchmap.py
>> +++ b/mercurial/branchmap.py
>> @@ -5,10 +5,11 @@
>> # This software may be used and distributed according to the terms of the
>> # GNU General Public License version 2 or any later version.
>>
>> from node import bin, hex, nullid, nullrev
>> import encoding
>> +import util
>>
>> def read(repo):
>> try:
>> f = repo.opener("cache/branchheads")
>> lines = f.read().split('\n')
>> @@ -67,22 +68,45 @@ def updatecache(repo):
>> repo._branchcache = partial
>>
>> class branchcache(dict):
>> """A dict like object that hold branches heads cache"""
>>
>> - def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev):
>> + def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev,
>> + filtered=None):
>> super(branchcache, self).__init__(entries)
>> self.tipnode = tipnode
>> self.tiprev = tiprev
>> + self.filtered = filtered
>
> Name of this property should indicate that it's a hash, not a list.
Should I name that `hashfiltered` or `filteredhash` ?
--
Pierre-Yves
More information about the Mercurial-devel
mailing list