Patchwork [10,of,10] manifest: delete manifest.manifest class

login
register
mail settings
Submitter Durham Goode
Date Nov. 9, 2016, 7:31 p.m.
Message ID <6b0d7823ab2c4442faac.1478719884@dev111.prn1.facebook.com>
Download mbox | patch
Permalink /patch/17427/
State Accepted
Headers show

Comments

Durham Goode - Nov. 9, 2016, 7:31 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1478687226 28800
#      Wed Nov 09 02:27:06 2016 -0800
# Node ID 6b0d7823ab2c4442faacb4e517752ff9b3f79065
# Parent  5cc0f288a11fc7cbf1e2526ee4269dd79889383e
manifest: delete manifest.manifest class

Now that nothing uses the primary manifest class, we can delete it.
Durham Goode - Nov. 9, 2016, 7:35 p.m.
Sorry for the long series, but this is the final series in the manifest 
refactor. The last patch deletes the manifest class.  All the patches 
are pretty easy too.


On 11/9/16 7:31 PM, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1478687226 28800
> #      Wed Nov 09 02:27:06 2016 -0800
> # Node ID 6b0d7823ab2c4442faacb4e517752ff9b3f79065
> # Parent  5cc0f288a11fc7cbf1e2526ee4269dd79889383e
> manifest: delete manifest.manifest class
>
> Now that nothing uses the primary manifest class, we can delete it.
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -508,7 +508,7 @@ class localrepository(object):
>           # This is a temporary function while we migrate from manifest to
>           # manifestlog. It allows bundlerepo and unionrepo to intercept the
>           # manifest creation.
> -        return manifest.manifest(self.svfs)
> +        return manifest.manifestrevlog(self.svfs)
>   
>       @storecache('00manifest.i')
>       def manifestlog(self):
> diff --git a/mercurial/manifest.py b/mercurial/manifest.py
> --- a/mercurial/manifest.py
> +++ b/mercurial/manifest.py
> @@ -1558,22 +1558,3 @@ class treemanifestctx(object):
>   
>       def find(self, key):
>           return self.read().find(key)
> -
> -class manifest(manifestrevlog):
> -    def __init__(self, opener, dir='', dirlogcache=None):
> -        '''The 'dir' and 'dirlogcache' arguments are for internal use by
> -        manifest.manifest only. External users should create a root manifest
> -        log with manifest.manifest(opener) and call dirlog() on it.
> -        '''
> -        # During normal operations, we expect to deal with not more than four
> -        # revs at a time (such as during commit --amend). When rebasing large
> -        # stacks of commits, the number can go up, hence the config knob below.
> -        cachesize = 4
> -        usetreemanifest = False
> -        opts = getattr(opener, 'options', None)
> -        if opts is not None:
> -            cachesize = opts.get('manifestcachesize', cachesize)
> -            usetreemanifest = opts.get('treemanifest', usetreemanifest)
> -        self._mancache = util.lrucachedict(cachesize)
> -        self._treeinmem = usetreemanifest
> -        super(manifest, self).__init__(opener, dir=dir, dirlogcache=dirlogcache)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DQIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=lDx5zEd8t8-jhhF14RJsXBY3IMNpkNpSTX7gwTihdIg&s=4Og1LbD9xRPXB_Pz77JzrOwJJqYMH5L0qdnzN3VyX2A&e=
Durham Goode - Nov. 9, 2016, 7:37 p.m.
Also, this series depends on the 7 patch series before. It seems like 
1-6 of that series was queued, but #7 has not been yet (though the email 
says it's to be queued).


On 11/9/16 7:35 PM, Durham Goode wrote:
> Sorry for the long series, but this is the final series in the 
> manifest refactor. The last patch deletes the manifest class.  All the 
> patches are pretty easy too.
>
>
> On 11/9/16 7:31 PM, Durham Goode wrote:
>> # HG changeset patch
>> # User Durham Goode <durham@fb.com>
>> # Date 1478687226 28800
>> #      Wed Nov 09 02:27:06 2016 -0800
>> # Node ID 6b0d7823ab2c4442faacb4e517752ff9b3f79065
>> # Parent  5cc0f288a11fc7cbf1e2526ee4269dd79889383e
>> manifest: delete manifest.manifest class
>>
>> Now that nothing uses the primary manifest class, we can delete it.
>>
>> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
>> --- a/mercurial/localrepo.py
>> +++ b/mercurial/localrepo.py
>> @@ -508,7 +508,7 @@ class localrepository(object):
>>           # This is a temporary function while we migrate from 
>> manifest to
>>           # manifestlog. It allows bundlerepo and unionrepo to 
>> intercept the
>>           # manifest creation.
>> -        return manifest.manifest(self.svfs)
>> +        return manifest.manifestrevlog(self.svfs)
>>         @storecache('00manifest.i')
>>       def manifestlog(self):
>> diff --git a/mercurial/manifest.py b/mercurial/manifest.py
>> --- a/mercurial/manifest.py
>> +++ b/mercurial/manifest.py
>> @@ -1558,22 +1558,3 @@ class treemanifestctx(object):
>>         def find(self, key):
>>           return self.read().find(key)
>> -
>> -class manifest(manifestrevlog):
>> -    def __init__(self, opener, dir='', dirlogcache=None):
>> -        '''The 'dir' and 'dirlogcache' arguments are for internal 
>> use by
>> -        manifest.manifest only. External users should create a root 
>> manifest
>> -        log with manifest.manifest(opener) and call dirlog() on it.
>> -        '''
>> -        # During normal operations, we expect to deal with not more 
>> than four
>> -        # revs at a time (such as during commit --amend). When 
>> rebasing large
>> -        # stacks of commits, the number can go up, hence the config 
>> knob below.
>> -        cachesize = 4
>> -        usetreemanifest = False
>> -        opts = getattr(opener, 'options', None)
>> -        if opts is not None:
>> -            cachesize = opts.get('manifestcachesize', cachesize)
>> -            usetreemanifest = opts.get('treemanifest', usetreemanifest)
>> -        self._mancache = util.lrucachedict(cachesize)
>> -        self._treeinmem = usetreemanifest
>> -        super(manifest, self).__init__(opener, dir=dir, 
>> dirlogcache=dirlogcache)
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DQIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=lDx5zEd8t8-jhhF14RJsXBY3IMNpkNpSTX7gwTihdIg&s=4Og1LbD9xRPXB_Pz77JzrOwJJqYMH5L0qdnzN3VyX2A&e= 
>>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DQIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=VU6sUqbldGnrPwq_Fc7CACMuWqR2ztGpmx-nnxw1J98&s=u0YT3P_4A0hhhx7kMgp66y6VVHZwRMKyYcdSlMmkx84&e=
via Mercurial-devel - Nov. 10, 2016, 10:54 p.m.
On Wed, Nov 9, 2016 at 11:37 AM, Durham Goode <durham@fb.com> wrote:
> Also, this series depends on the 7 patch series before. It seems like 1-6 of
> that series was queued, but #7 has not been yet (though the email says it's
> to be queued).
>
>
>
> On 11/9/16 7:35 PM, Durham Goode wrote:
>>
>> Sorry for the long series, but this is the final series in the manifest
>> refactor. The last patch deletes the manifest class.  All the patches are
>> pretty easy too.

Even after this series, there is still localrepo._constructmanifest()
that's documented like this:

        # This is a temporary function while we migrate from manifest to
        # manifestlog. It allows bundlerepo and unionrepo to intercept the
        # manifest creation.

>>
>>
>> On 11/9/16 7:31 PM, Durham Goode wrote:
>>>
>>> # HG changeset patch
>>> # User Durham Goode <durham@fb.com>
>>> # Date 1478687226 28800
>>> #      Wed Nov 09 02:27:06 2016 -0800
>>> # Node ID 6b0d7823ab2c4442faacb4e517752ff9b3f79065
>>> # Parent  5cc0f288a11fc7cbf1e2526ee4269dd79889383e
>>> manifest: delete manifest.manifest class
>>>
>>> Now that nothing uses the primary manifest class, we can delete it.
>>>
>>> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
>>> --- a/mercurial/localrepo.py
>>> +++ b/mercurial/localrepo.py
>>> @@ -508,7 +508,7 @@ class localrepository(object):
>>>           # This is a temporary function while we migrate from manifest
>>> to
>>>           # manifestlog. It allows bundlerepo and unionrepo to intercept
>>> the
>>>           # manifest creation.
>>> -        return manifest.manifest(self.svfs)
>>> +        return manifest.manifestrevlog(self.svfs)
>>>         @storecache('00manifest.i')
>>>       def manifestlog(self):
>>> diff --git a/mercurial/manifest.py b/mercurial/manifest.py
>>> --- a/mercurial/manifest.py
>>> +++ b/mercurial/manifest.py
>>> @@ -1558,22 +1558,3 @@ class treemanifestctx(object):
>>>         def find(self, key):
>>>           return self.read().find(key)
>>> -
>>> -class manifest(manifestrevlog):
>>> -    def __init__(self, opener, dir='', dirlogcache=None):
>>> -        '''The 'dir' and 'dirlogcache' arguments are for internal use by
>>> -        manifest.manifest only. External users should create a root
>>> manifest
>>> -        log with manifest.manifest(opener) and call dirlog() on it.
>>> -        '''
>>> -        # During normal operations, we expect to deal with not more than
>>> four
>>> -        # revs at a time (such as during commit --amend). When rebasing
>>> large
>>> -        # stacks of commits, the number can go up, hence the config knob
>>> below.
>>> -        cachesize = 4
>>> -        usetreemanifest = False
>>> -        opts = getattr(opener, 'options', None)
>>> -        if opts is not None:
>>> -            cachesize = opts.get('manifestcachesize', cachesize)
>>> -            usetreemanifest = opts.get('treemanifest', usetreemanifest)
>>> -        self._mancache = util.lrucachedict(cachesize)
>>> -        self._treeinmem = usetreemanifest
>>> -        super(manifest, self).__init__(opener, dir=dir,
>>> dirlogcache=dirlogcache)
>>> _______________________________________________
>>> Mercurial-devel mailing list
>>> Mercurial-devel@mercurial-scm.org
>>>
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DQIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=lDx5zEd8t8-jhhF14RJsXBY3IMNpkNpSTX7gwTihdIg&s=4Og1LbD9xRPXB_Pz77JzrOwJJqYMH5L0qdnzN3VyX2A&e=
>>
>>
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DQIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=VU6sUqbldGnrPwq_Fc7CACMuWqR2ztGpmx-nnxw1J98&s=u0YT3P_4A0hhhx7kMgp66y6VVHZwRMKyYcdSlMmkx84&e=
>
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Durham Goode - Nov. 11, 2016, 9:19 a.m.
On 11/10/16 10:54 PM, Martin von Zweigbergk wrote:
> On Wed, Nov 9, 2016 at 11:37 AM, Durham Goode <durham@fb.com> wrote:
>> Also, this series depends on the 7 patch series before. It seems like 1-6 of
>> that series was queued, but #7 has not been yet (though the email says it's
>> to be queued).
>>
>>
>>
>> On 11/9/16 7:35 PM, Durham Goode wrote:
>>> Sorry for the long series, but this is the final series in the manifest
>>> refactor. The last patch deletes the manifest class.  All the patches are
>>> pretty easy too.
> Even after this series, there is still localrepo._constructmanifest()
> that's documented like this:
>
>          # This is a temporary function while we migrate from manifest to
>          # manifestlog. It allows bundlerepo and unionrepo to intercept the
>          # manifest creation.
Yea, there's a couple patches of cleanup left (getting rid of the 
repo->manifestlog->repo cycle, and cleaning up _construct), but this is 
the last series around getting rid of the manifest class.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -508,7 +508,7 @@  class localrepository(object):
         # This is a temporary function while we migrate from manifest to
         # manifestlog. It allows bundlerepo and unionrepo to intercept the
         # manifest creation.
-        return manifest.manifest(self.svfs)
+        return manifest.manifestrevlog(self.svfs)
 
     @storecache('00manifest.i')
     def manifestlog(self):
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1558,22 +1558,3 @@  class treemanifestctx(object):
 
     def find(self, key):
         return self.read().find(key)
-
-class manifest(manifestrevlog):
-    def __init__(self, opener, dir='', dirlogcache=None):
-        '''The 'dir' and 'dirlogcache' arguments are for internal use by
-        manifest.manifest only. External users should create a root manifest
-        log with manifest.manifest(opener) and call dirlog() on it.
-        '''
-        # During normal operations, we expect to deal with not more than four
-        # revs at a time (such as during commit --amend). When rebasing large
-        # stacks of commits, the number can go up, hence the config knob below.
-        cachesize = 4
-        usetreemanifest = False
-        opts = getattr(opener, 'options', None)
-        if opts is not None:
-            cachesize = opts.get('manifestcachesize', cachesize)
-            usetreemanifest = opts.get('treemanifest', usetreemanifest)
-        self._mancache = util.lrucachedict(cachesize)
-        self._treeinmem = usetreemanifest
-        super(manifest, self).__init__(opener, dir=dir, dirlogcache=dirlogcache)