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

login
register
mail settings
Submitter Durham Goode
Date Nov. 11, 2016, 9:26 a.m.
Message ID <acfce2847051126bf6fc.1478856403@dev111.prn1.facebook.com>
Download mbox | patch
Permalink /patch/17489/
State Accepted
Headers show

Comments

Durham Goode - Nov. 11, 2016, 9:26 a.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1478772799 28800
#      Thu Nov 10 02:13:19 2016 -0800
# Node ID acfce2847051126bf6fc0cabbefaaa5f95029ea3
# Parent  79695a7fa946030ccbabae079e6106cea7932ba1
manifest: delete manifest.manifest class

Now that nothing uses the primary manifest class, we can delete it.
via Mercurial-devel - Nov. 11, 2016, 3:20 p.m.
I'm not working today, but the series looks good to me, so if anyone else
wants to queue it, go ahead.

On Fri, Nov 11, 2016, 01:26 Durham Goode <durham@fb.com> wrote:

> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1478772799 28800
> #      Thu Nov 10 02:13:19 2016 -0800
> # Node ID acfce2847051126bf6fc0cabbefaaa5f95029ea3
> # Parent  79695a7fa946030ccbabae079e6106cea7932ba1
> 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)
>
via Mercurial-devel - Nov. 12, 2016, 6:13 a.m.
On Fri, Nov 11, 2016 at 7:20 AM, Martin von Zweigbergk
<martinvonz@google.com> wrote:
> I'm not working today, but the series looks good to me, so if anyone else
> wants to queue it, go ahead.

Queued, thanks.

Did you get anywhere with adapting narrowhg to work with the new
manifest APIs? Otherwise I'll probably look into that within the next
few days.

>
>
> On Fri, Nov 11, 2016, 01:26 Durham Goode <durham@fb.com> wrote:
>>
>> # HG changeset patch
>> # User Durham Goode <durham@fb.com>
>> # Date 1478772799 28800
>> #      Thu Nov 10 02:13:19 2016 -0800
>> # Node ID acfce2847051126bf6fc0cabbefaaa5f95029ea3
>> # Parent  79695a7fa946030ccbabae079e6106cea7932ba1
>> 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)
Durham Goode - Nov. 14, 2016, 4:57 p.m.
On 11/11/16 10:13 PM, Martin von Zweigbergk wrote:
> On Fri, Nov 11, 2016 at 7:20 AM, Martin von Zweigbergk
> <martinvonz@google.com> wrote:
>> I'm not working today, but the series looks good to me, so if anyone else
>> wants to queue it, go ahead.
> Queued, thanks.
>
> Did you get anywhere with adapting narrowhg to work with the new
> manifest APIs? Otherwise I'll probably look into that within the next
> few days.
>
I'm going to look at it today, along with fixing our extensions for the 
same changes.

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)