Mercurial > hg
comparison mercurial/manifest.py @ 29715:55d341877316
bundlerepo: add support for treemanifests in cg3 bundles
This is a little messier than I'd like, and I'll probably come back
and do some more refactoring later, but as it is this unblocks
narrowhg. An alternative approach (which I may do as part of the
mentioned refactoring) would be to construct *all* dirlog instances up
front, so that we don't have to keep track of the linkmapper
method. This would avoid a reference cycle between the bundlemanifest
and the bundlerepository, but I was hesitant to do all the work up
front like that.
With this change, it's possible to do 'hg incoming' and 'hg pull' from
bundles in .hg/strip-backup in a treemanifest repository. Sadly, this
doesn't make it possible to 'hg clone' one of those (if you do 'hg
strip 0'), because the cg3 in the bundle gets written without a
treemanifest flag. Since that's going to be an involved refactor in a
different part of the code (which I *suspect* won't touch any of the
code I've just written here), let's leave it as an idea for Later.
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 05 Aug 2016 13:08:11 -0400 |
parents | 98e8313dcd9e |
children | 27c0792e834c |
comparison
equal
deleted
inserted
replaced
29714:69109052d9ac | 29715:55d341877316 |
---|---|
911 self._treeinmem = usetreemanifest | 911 self._treeinmem = usetreemanifest |
912 self._treeondisk = usetreemanifest | 912 self._treeondisk = usetreemanifest |
913 self._usemanifestv2 = usemanifestv2 | 913 self._usemanifestv2 = usemanifestv2 |
914 indexfile = "00manifest.i" | 914 indexfile = "00manifest.i" |
915 if dir: | 915 if dir: |
916 assert self._treeondisk | 916 assert self._treeondisk, 'opts is %r' % opts |
917 if not dir.endswith('/'): | 917 if not dir.endswith('/'): |
918 dir = dir + '/' | 918 dir = dir + '/' |
919 indexfile = "meta/" + dir + "00manifest.i" | 919 indexfile = "meta/" + dir + "00manifest.i" |
920 revlog.revlog.__init__(self, opener, indexfile) | 920 revlog.revlog.__init__(self, opener, indexfile) |
921 self._dir = dir | 921 self._dir = dir |