Patchwork [1,of,8] manifest: move treeinmem onto manifestlog

login
register
mail settings
Submitter Durham Goode
Date Sept. 14, 2016, 11:04 p.m.
Message ID <a68f73ff397c43941039.1473894271@dev111.prn1.facebook.com>
Download mbox | patch
Permalink /patch/16634/
State Superseded
Headers show

Comments

Durham Goode - Sept. 14, 2016, 11:04 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1473893509 25200
#      Wed Sep 14 15:51:49 2016 -0700
# Node ID a68f73ff397c439410395363049a0679a847b425
# Parent  459cbb3804144a4cabb6622b6d66616cadd35ade
manifest: move treeinmem onto manifestlog

A previous patched moved all the serialization related options onto
manifestrevlog (since it is responsible for serialization). Let's move the
treeinmem option on manifestlog, since it is responsible for materialization
decisions. This reduces the number of dependencies manifestlog has on the old
manifest type as well, so we can eventually make them completely independent of
each other.
via Mercurial-devel - Sept. 15, 2016, 5:58 a.m.
On Wed, Sep 14, 2016 at 4:04 PM, Durham Goode <durham@fb.com> wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1473893509 25200
> #      Wed Sep 14 15:51:49 2016 -0700
> # Node ID a68f73ff397c439410395363049a0679a847b425
> # Parent  459cbb3804144a4cabb6622b6d66616cadd35ade
> manifest: move treeinmem onto manifestlog
>
> A previous patched moved all the serialization related options onto
> manifestrevlog (since it is responsible for serialization). Let's move the
> treeinmem option on manifestlog, since it is responsible for materialization
> decisions. This reduces the number of dependencies manifestlog has on the old
> manifest type as well, so we can eventually make them completely independent of
> each other.
>
> diff --git a/mercurial/manifest.py b/mercurial/manifest.py
> --- a/mercurial/manifest.py
> +++ b/mercurial/manifest.py
> @@ -957,6 +957,13 @@ class manifestlog(object):
>      def __init__(self, opener, repo):
>          self._repo = repo
>
> +        usetreemanifest = False
> +
> +        opts = getattr(opener, 'options', None)
> +        if opts is not None:
> +            usetreemanifest = opts.get('treemanifest', usetreemanifest)
> +        self._treeinmem = usetreemanifest
> +
>          # We'll separate this into it's own cache once oldmanifest is no longer
>          # used
>          self._mancache = repo.manifest._mancache
> @@ -984,7 +991,7 @@ class manifestlog(object):
>                  isinstance(cachemf, treemanifestctx)):
>                  return cachemf
>
> -        if self._oldmanifest._treeinmem:

Can _oldmanifest be removed in this patch?

> +        if self._treeinmem:
>              m = treemanifestctx(self._revlog, '', node)
>          else:
>              m = manifestctx(self._revlog, node)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Durham Goode - Sept. 15, 2016, 5:29 p.m.
On 9/14/16 10:58 PM, Martin von Zweigbergk wrote:
> On Wed, Sep 14, 2016 at 4:04 PM, Durham Goode <durham@fb.com> wrote:
>> # HG changeset patch
>> # User Durham Goode <durham@fb.com>
>> # Date 1473893509 25200
>> #      Wed Sep 14 15:51:49 2016 -0700
>> # Node ID a68f73ff397c439410395363049a0679a847b425
>> # Parent  459cbb3804144a4cabb6622b6d66616cadd35ade
>> manifest: move treeinmem onto manifestlog
>>
>> A previous patched moved all the serialization related options onto
>> manifestrevlog (since it is responsible for serialization). Let's move the
>> treeinmem option on manifestlog, since it is responsible for materialization
>> decisions. This reduces the number of dependencies manifestlog has on the old
>> manifest type as well, so we can eventually make them completely independent of
>> each other.
>>
>> diff --git a/mercurial/manifest.py b/mercurial/manifest.py
>> --- a/mercurial/manifest.py
>> +++ b/mercurial/manifest.py
>> @@ -957,6 +957,13 @@ class manifestlog(object):
>>       def __init__(self, opener, repo):
>>           self._repo = repo
>>
>> +        usetreemanifest = False
>> +
>> +        opts = getattr(opener, 'options', None)
>> +        if opts is not None:
>> +            usetreemanifest = opts.get('treemanifest', usetreemanifest)
>> +        self._treeinmem = usetreemanifest
>> +
>>           # We'll separate this into it's own cache once oldmanifest is no longer
>>           # used
>>           self._mancache = repo.manifest._mancache
>> @@ -984,7 +991,7 @@ class manifestlog(object):
>>                   isinstance(cachemf, treemanifestctx)):
>>                   return cachemf
>>
>> -        if self._oldmanifest._treeinmem:
> Can _oldmanifest be removed in this patch?
Yea, I guess we could.  It gets removed later down the series anyway 
(when we get rid of the _revlog property).  I can delete it here if you 
want though.
via Mercurial-devel - Sept. 15, 2016, 5:31 p.m.
On Thu, Sep 15, 2016 at 10:29 AM, Durham Goode <durham@fb.com> wrote:
>
>
> On 9/14/16 10:58 PM, Martin von Zweigbergk wrote:
>>
>> On Wed, Sep 14, 2016 at 4:04 PM, Durham Goode <durham@fb.com> wrote:
>>>
>>> # HG changeset patch
>>> # User Durham Goode <durham@fb.com>
>>> # Date 1473893509 25200
>>> #      Wed Sep 14 15:51:49 2016 -0700
>>> # Node ID a68f73ff397c439410395363049a0679a847b425
>>> # Parent  459cbb3804144a4cabb6622b6d66616cadd35ade
>>> manifest: move treeinmem onto manifestlog
>>>
>>> A previous patched moved all the serialization related options onto
>>> manifestrevlog (since it is responsible for serialization). Let's move
>>> the
>>> treeinmem option on manifestlog, since it is responsible for
>>> materialization
>>> decisions. This reduces the number of dependencies manifestlog has on the
>>> old
>>> manifest type as well, so we can eventually make them completely
>>> independent of
>>> each other.
>>>
>>> diff --git a/mercurial/manifest.py b/mercurial/manifest.py
>>> --- a/mercurial/manifest.py
>>> +++ b/mercurial/manifest.py
>>> @@ -957,6 +957,13 @@ class manifestlog(object):
>>>       def __init__(self, opener, repo):
>>>           self._repo = repo
>>>
>>> +        usetreemanifest = False
>>> +
>>> +        opts = getattr(opener, 'options', None)
>>> +        if opts is not None:
>>> +            usetreemanifest = opts.get('treemanifest', usetreemanifest)
>>> +        self._treeinmem = usetreemanifest
>>> +
>>>           # We'll separate this into it's own cache once oldmanifest is
>>> no longer
>>>           # used
>>>           self._mancache = repo.manifest._mancache
>>> @@ -984,7 +991,7 @@ class manifestlog(object):
>>>                   isinstance(cachemf, treemanifestctx)):
>>>                   return cachemf
>>>
>>> -        if self._oldmanifest._treeinmem:
>>
>> Can _oldmanifest be removed in this patch?
>
> Yea, I guess we could.  It gets removed later down the series anyway (when
> we get rid of the _revlog property).  I can delete it here if you want
> though.

Please do. I find it easier to see what remains to be done if we
delete things as we go. I can just delete it in flight. And update the
comment with s/oldmanifest/repo.manifest/, right?
Durham Goode - Sept. 15, 2016, 5:33 p.m.
On 9/15/16 10:31 AM, Martin von Zweigbergk wrote:
> On Thu, Sep 15, 2016 at 10:29 AM, Durham Goode <durham@fb.com> wrote:
>>
>> On 9/14/16 10:58 PM, Martin von Zweigbergk wrote:
>>> On Wed, Sep 14, 2016 at 4:04 PM, Durham Goode <durham@fb.com> wrote:
>>>> # HG changeset patch
>>>> # User Durham Goode <durham@fb.com>
>>>> # Date 1473893509 25200
>>>> #      Wed Sep 14 15:51:49 2016 -0700
>>>> # Node ID a68f73ff397c439410395363049a0679a847b425
>>>> # Parent  459cbb3804144a4cabb6622b6d66616cadd35ade
>>>> manifest: move treeinmem onto manifestlog
>>>>
>>>> A previous patched moved all the serialization related options onto
>>>> manifestrevlog (since it is responsible for serialization). Let's move
>>>> the
>>>> treeinmem option on manifestlog, since it is responsible for
>>>> materialization
>>>> decisions. This reduces the number of dependencies manifestlog has on the
>>>> old
>>>> manifest type as well, so we can eventually make them completely
>>>> independent of
>>>> each other.
>>>>
>>>> diff --git a/mercurial/manifest.py b/mercurial/manifest.py
>>>> --- a/mercurial/manifest.py
>>>> +++ b/mercurial/manifest.py
>>>> @@ -957,6 +957,13 @@ class manifestlog(object):
>>>>        def __init__(self, opener, repo):
>>>>            self._repo = repo
>>>>
>>>> +        usetreemanifest = False
>>>> +
>>>> +        opts = getattr(opener, 'options', None)
>>>> +        if opts is not None:
>>>> +            usetreemanifest = opts.get('treemanifest', usetreemanifest)
>>>> +        self._treeinmem = usetreemanifest
>>>> +
>>>>            # We'll separate this into it's own cache once oldmanifest is
>>>> no longer
>>>>            # used
>>>>            self._mancache = repo.manifest._mancache
>>>> @@ -984,7 +991,7 @@ class manifestlog(object):
>>>>                    isinstance(cachemf, treemanifestctx)):
>>>>                    return cachemf
>>>>
>>>> -        if self._oldmanifest._treeinmem:
>>> Can _oldmanifest be removed in this patch?
>> Yea, I guess we could.  It gets removed later down the series anyway (when
>> we get rid of the _revlog property).  I can delete it here if you want
>> though.
> Please do. I find it easier to see what remains to be done if we
> delete things as we go. I can just delete it in flight. And update the
> comment with s/oldmanifest/repo.manifest/, right?
Yup, feel free to delete in flight.  Otherwise let me know and I'll resend.

Patch

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -957,6 +957,13 @@  class manifestlog(object):
     def __init__(self, opener, repo):
         self._repo = repo
 
+        usetreemanifest = False
+
+        opts = getattr(opener, 'options', None)
+        if opts is not None:
+            usetreemanifest = opts.get('treemanifest', usetreemanifest)
+        self._treeinmem = usetreemanifest
+
         # We'll separate this into it's own cache once oldmanifest is no longer
         # used
         self._mancache = repo.manifest._mancache
@@ -984,7 +991,7 @@  class manifestlog(object):
                 isinstance(cachemf, treemanifestctx)):
                 return cachemf
 
-        if self._oldmanifest._treeinmem:
+        if self._treeinmem:
             m = treemanifestctx(self._revlog, '', node)
         else:
             m = manifestctx(self._revlog, node)