Patchwork [1,of,2,V4] manifest: make one use of _mancache avoid manifestctxs

login
register
mail settings
Submitter Durham Goode
Date Sept. 12, 2016, 9:33 p.m.
Message ID <3a45359ff38aee2b4da2.1473716020@dev111.prn1.facebook.com>
Download mbox | patch
Permalink /patch/16599/
State Accepted
Headers show

Comments

Durham Goode - Sept. 12, 2016, 9:33 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1473715749 25200
#      Mon Sep 12 14:29:09 2016 -0700
# Node ID 3a45359ff38aee2b4da284186024c3a83cc2b3ae
# Parent  8a658b8b795aaea5e9fe34ae26a49b4656c594cb
manifest: make one use of _mancache avoid manifestctxs

In a future patch we will change manifestctx and treemanifestctx to no longer
derive from manifestdict and treemanifest, respectively. This means that
consumers of the _mancache will now need to be aware of the different between
the two, until we get rid of the manifest entirely and the _mancache becomes
only filled with ctxs.

This fixes one case of it that can be fixed by using the other cache. Future
patches will address the others uses using the upcoming manifestctx.read()
function.
Pierre-Yves David - Sept. 12, 2016, 11:10 p.m.
On 09/12/2016 11:33 PM, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1473715749 25200
> #      Mon Sep 12 14:29:09 2016 -0700
> # Node ID 3a45359ff38aee2b4da284186024c3a83cc2b3ae
> # Parent  8a658b8b795aaea5e9fe34ae26a49b4656c594cb
> manifest: make one use of _mancache avoid manifestctxs
>
> In a future patch we will change manifestctx and treemanifestctx to no longer
> derive from manifestdict and treemanifest, respectively. This means that
> consumers of the _mancache will now need to be aware of the different between
> the two, until we get rid of the manifest entirely and the _mancache becomes
> only filled with ctxs.
>
> This fixes one case of it that can be fixed by using the other cache. Future
> patches will address the others uses using the upcoming manifestctx.read()
> function.

It seems like the commit content have drifted far enough that the 
description if no longer accurate :-/. If so, can you send an updated 
version?
(Or, I'm failing to understand it for some other reason).

>
> diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
> --- a/mercurial/bundlerepo.py
> +++ b/mercurial/bundlerepo.py
> @@ -204,8 +204,8 @@ class bundlemanifest(bundlerevlog, manif
>          if isinstance(node, int):
>              node = self.node(node)
>
> -        if node in self._mancache:
> -            result = self._mancache[node].text()
> +        if node in self.fulltextcache:
> +            result = self.fulltextcache[node].tostring()
>          else:
>              result = manifest.manifest.revision(self, nodeorrev)
>          return result

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -204,8 +204,8 @@  class bundlemanifest(bundlerevlog, manif
         if isinstance(node, int):
             node = self.node(node)
 
-        if node in self._mancache:
-            result = self._mancache[node].text()
+        if node in self.fulltextcache:
+            result = self.fulltextcache[node].tostring()
         else:
             result = manifest.manifest.revision(self, nodeorrev)
         return result