[PATCH 2 of 4 STABLE] manifest: make manifestlog a storecache

Durham Goode durham at fb.com
Tue Oct 25 19:45:17 UTC 2016



On 10/22/16 2:09 AM, Yuya Nishihara wrote:
> On Tue, 18 Oct 2016 17:50:15 -0700, Durham Goode wrote:
>> # HG changeset patch
>> # User Durham Goode <durham at fb.com>
>> # Date 1476837219 25200
>> #      Tue Oct 18 17:33:39 2016 -0700
>> # Branch stable
>> # Node ID ed607426a3ff4deda8c7f2de8b86d5b6ca976d67
>> # Parent  f4e70498d617737c47371a86c2177146c7b789fe
>> manifest: make manifestlog a storecache
>> --- a/mercurial/localrepo.py
>> +++ b/mercurial/localrepo.py
>> @@ -504,9 +504,9 @@ class localrepository(object):
>>                   c.readpending('00changelog.i.a')
>>           return c
>>   
>> -    @storecache('00manifest.i')
>> +    @property
>>       def manifest(self):
>> -        return self._constructmanifest()
>> +        return self.manifestlog._oldmanifest
>>   
>>       def _constructmanifest(self):
>>           # This is a temporary function while we migrate from manifest to
>> @@ -514,7 +514,7 @@ class localrepository(object):
>>           # manifest creation.
>>           return manifest.manifest(self.svfs)
>>   
>> -    @property
>> +    @storecache('00manifest.i')
>>       def manifestlog(self):
>>           return manifest.manifestlog(self.svfs, self)
> Can we remove manifestlog._repo to cut reference cycle?
Right now everything that attempts to access the manifest must do it 
through the repo object.  So in order for ctx objects to read from the 
manifest, it has to have the repo object (which is why changectx has the 
repo object now).  Once we get rid of repo.manifest entirely, we can 
probably move the 00manifest.i caching down a layer into the 
manifestlog, and we could break the need to store the repo in the 
manifestlog.  I'll do that as part of the remainder of my manifest 
refactor series.



More information about the Mercurial-devel mailing list