treemanifest: add local pack store to unionstore

Summary:
In a future patch we will start writing user local tree data into a local
directory. This patches add the local store to the union store so the contents
will be accessible once we start writing it.

It also renames manifest to manifests for consistency with the other store names
(like 'packs').

Test Plan: Ran the tests

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4055827

Signature: t1:4055827:1477059457:0d5b0d999b47d88c73f5ab2721d8d27deacc01bc
This commit is contained in:
Durham Goode 2016-10-21 11:02:22 -07:00
parent 4235752853
commit 3707e186b6
2 changed files with 14 additions and 5 deletions

View File

@ -68,6 +68,9 @@ def getcachepackpath(repo, category):
else:
return os.path.join(cachepath, repo.name, 'packs')
def getlocalpackpath(base, category):
return os.path.join(base, 'packs', category)
def createrevlogtext(text, copyfrom=None, copyrev=None):
"""returns a string that matches the revlog contents in a
traditional revlog

View File

@ -26,7 +26,7 @@ import struct
cmdtable = {}
command = cmdutil.command(cmdtable)
PACK_CATEGORY='manifest'
PACK_CATEGORY='manifests'
def extsetup(ui):
extensions.wrapfunction(changegroup.cg1unpacker, '_unpackmanifests',
@ -39,11 +39,17 @@ def wraprepo(repo):
if not isinstance(repo, localrepo.localrepository):
return
usecdatapack = repo.ui.configbool('remotefilelog', 'fastdatapack')
packpath = shallowutil.getcachepackpath(repo, PACK_CATEGORY)
datastore = datapackstore(
packpath,
usecdatapack=repo.ui.configbool('remotefilelog', 'fastdatapack'))
repo.svfs.manifestdatastore = unioncontentstore(datastore)
datastore = datapackstore(packpath, usecdatapack=usecdatapack)
localpackpath = shallowutil.getlocalpackpath(repo.svfs.vfs.base,
PACK_CATEGORY)
localdatastore = datapackstore(localpackpath, usecdatapack=usecdatapack)
repo.svfs.manifestdatastore = unioncontentstore(localdatastore, datastore,
writestore=localdatastore)
def _unpackmanifests(orig, self, repo, *args, **kwargs):
mf = repo.manifest