# HG changeset patch # User Martin von Zweigbergk # Date 2015-04-11 01:54:33 # Node ID 03ee576784e68d9396b6e97a3d150815c414eb0d # Parent 32b268cbff00b6af35c5ce82c4b93f8934febabc treemanifest: separate flags for trees in memory and trees on disk When we start writing tree manifests with one manifest revlog per directory, it will still be nice to be able to run tests using tree manifests in memory but writing to a flat manifest to a single revlog. Let's break the current '_usetreemanifest' flag on the revlog into '_treeinmem' and '_treeondisk'. Both are populated from the same config, but after this change, one can temporarily hard-code _treeinmem=True to see that tests still pass. diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -761,11 +761,12 @@ class manifest(revlog.revlog): usemanifestv2 = opts.get('manifestv2', usemanifestv2) self._mancache = util.lrucachedict(cachesize) revlog.revlog.__init__(self, opener, "00manifest.i") - self._usetreemanifest = usetreemanifest + self._treeinmem = usetreemanifest + self._treeondisk = usetreemanifest self._usemanifestv2 = usemanifestv2 def _newmanifest(self, data=''): - if self._usetreemanifest: + if self._treeinmem: return treemanifest('', data) return manifestdict(data) @@ -782,7 +783,7 @@ class manifest(revlog.revlog): return md def readdelta(self, node): - if self._usemanifestv2 or self._usetreemanifest: + if self._usemanifestv2 or self._treeondisk: return self._slowreaddelta(node) r = self.rev(node) d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r)) @@ -817,7 +818,7 @@ class manifest(revlog.revlog): return None, None def add(self, m, transaction, link, p1, p2, added, removed): - if (p1 in self._mancache and not self._usetreemanifest + if (p1 in self._mancache and not self._treeinmem and not self._usemanifestv2): # If our first parent is in the manifest cache, we can # compute a delta here using properties we know about the