Patchwork [06,of,10] manifest: add bundlemanifestlog support

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

Comments

Durham Goode - Nov. 9, 2016, 7:31 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1478684308 28800
#      Wed Nov 09 01:38:28 2016 -0800
# Node ID 04ec4875fac7d14c91e82525cc40b8e7084e673a
# Parent  604c120a5f8643b424f397d4db539675f00627e4
manifest: add bundlemanifestlog support

As part of deprecating manifest.manifest we need to make bundlerepo support
manifestlog.
via Mercurial-devel - Nov. 10, 2016, 10:49 p.m.
On Wed, Nov 9, 2016 at 11:31 AM, Durham Goode <durham@fb.com> wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1478684308 28800
> #      Wed Nov 09 01:38:28 2016 -0800
> # Node ID 04ec4875fac7d14c91e82525cc40b8e7084e673a
> # Parent  604c120a5f8643b424f397d4db539675f00627e4
> manifest: add bundlemanifestlog support
>
> As part of deprecating manifest.manifest we need to make bundlerepo support
> manifestlog.
>
> diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
> --- a/mercurial/bundlerepo.py
> +++ b/mercurial/bundlerepo.py
> @@ -187,9 +187,14 @@ class bundlechangelog(bundlerevlog, chan
>          finally:
>              self.filteredrevs = oldfilter
>
> -class bundlemanifest(bundlerevlog, manifest.manifest):
> +class bundlemanifestlog(manifest.manifestlog):

Used where?

> +    def __init__(self, opener, repo, bundle, linkmapper):
> +        manifest.manifestlog.__init__(self, opener, repo)
> +        self._revlog = bundlemanifest(opener, bundle, linkmapper)
> +
> +class bundlemanifest(bundlerevlog, manifest.manifestrevlog):
>      def __init__(self, opener, bundle, linkmapper, dirlogstarts=None, dir=''):
> -        manifest.manifest.__init__(self, opener, dir=dir)
> +        manifest.manifestrevlog.__init__(self, opener, dir=dir)
>          bundlerevlog.__init__(self, opener, self.indexfile, bundle,
>                                linkmapper)
>          if dirlogstarts is None:
> @@ -207,7 +212,7 @@ class bundlemanifest(bundlerevlog, manif
>          if node in self.fulltextcache:
>              result = self.fulltextcache[node].tostring()
>          else:
> -            result = manifest.manifest.revision(self, nodeorrev)
> +            result = manifest.manifestrevlog.revision(self, nodeorrev)
>          return result
>
>      def dirlog(self, d):
Durham Goode - Nov. 11, 2016, 9:18 a.m.
On 11/10/16 10:49 PM, Martin von Zweigbergk wrote:
> On Wed, Nov 9, 2016 at 11:31 AM, Durham Goode <durham@fb.com> wrote:
>> # HG changeset patch
>> # User Durham Goode <durham@fb.com>
>> # Date 1478684308 28800
>> #      Wed Nov 09 01:38:28 2016 -0800
>> # Node ID 04ec4875fac7d14c91e82525cc40b8e7084e673a
>> # Parent  604c120a5f8643b424f397d4db539675f00627e4
>> manifest: add bundlemanifestlog support
>>
>> As part of deprecating manifest.manifest we need to make bundlerepo support
>> manifestlog.
>>
>> diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
>> --- a/mercurial/bundlerepo.py
>> +++ b/mercurial/bundlerepo.py
>> @@ -187,9 +187,14 @@ class bundlechangelog(bundlerevlog, chan
>>           finally:
>>               self.filteredrevs = oldfilter
>>
>> -class bundlemanifest(bundlerevlog, manifest.manifest):
>> +class bundlemanifestlog(manifest.manifestlog):
> Used where?
>
You're right. This is an artifact from an old version.  I'll resend and 
drop this class (and the unionmanifestlog class which is also unnecessary).

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -187,9 +187,14 @@  class bundlechangelog(bundlerevlog, chan
         finally:
             self.filteredrevs = oldfilter
 
-class bundlemanifest(bundlerevlog, manifest.manifest):
+class bundlemanifestlog(manifest.manifestlog):
+    def __init__(self, opener, repo, bundle, linkmapper):
+        manifest.manifestlog.__init__(self, opener, repo)
+        self._revlog = bundlemanifest(opener, bundle, linkmapper)
+
+class bundlemanifest(bundlerevlog, manifest.manifestrevlog):
     def __init__(self, opener, bundle, linkmapper, dirlogstarts=None, dir=''):
-        manifest.manifest.__init__(self, opener, dir=dir)
+        manifest.manifestrevlog.__init__(self, opener, dir=dir)
         bundlerevlog.__init__(self, opener, self.indexfile, bundle,
                               linkmapper)
         if dirlogstarts is None:
@@ -207,7 +212,7 @@  class bundlemanifest(bundlerevlog, manif
         if node in self.fulltextcache:
             result = self.fulltextcache[node].tostring()
         else:
-            result = manifest.manifest.revision(self, nodeorrev)
+            result = manifest.manifestrevlog.revision(self, nodeorrev)
         return result
 
     def dirlog(self, d):