Mercurial > hg
changeset 24701:03ee576784e6
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.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 10 Apr 2015 18:54:33 -0700 |
parents | 32b268cbff00 |
children | 2b0449255800 |
files | mercurial/manifest.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/manifest.py Fri Apr 10 18:13:01 2015 -0700 +++ b/mercurial/manifest.py Fri Apr 10 18:54:33 2015 -0700 @@ -761,11 +761,12 @@ 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 @@ 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 @@ 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