treemanifest: access stores through vfs when needed

Summary:
When using a bundle repo, the actual opener object is a readonly vfs instance
that wraps the real vfs. Since we store the manifest stores on the real vfs, we
need to look at it when necessary. This will be useful later when dealing with
bundle repos.

Test Plan:
Ran the tests. In a future diff I use the tree store with bundle
repos which verifies that this code path works.

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mitrandir, medson, mjpieters

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

Signature: t1:5326250:1499349167:8830999032090e8754f433f60ae9bb8ccc45b6cd
This commit is contained in:
Durham Goode 2017-07-10 15:53:12 -07:00
parent 0ce2a60ef6
commit 8206f51a1c

View File

@ -138,7 +138,10 @@ class hybridmanifest(object):
store = self.opener.manifestdatastore
self.__treemanifest = cstore.treemanifest(store)
else:
store = self.opener.manifestdatastore
if util.safehasattr(self.opener, 'manifestdatastore'):
store = self.opener.manifestdatastore
else:
store = self.opener.vfs.manifestdatastore
try:
store.get('', self.node)
self.__treemanifest = cstore.treemanifest(store,