mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
[fastmanifest] have debugfastmanifest consistently return a fastmanifest
Summary: When fastmanifest.debugfastmanifest is set to True, we always return a fastmanifest. If the cache is empty, we will convert a flat manifest into a fastmanifest and use that for all operations. Same goal as D3247484. Test Plan: pass some unit tests in the mercurial suite. need to investigate the remaining issues. Reviewers: #mercurial, lcharignon Reviewed By: lcharignon Subscribers: mitrandir, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D3295434 Signature: t1:3295434:1463439017:0a6d20fa23fe409094e35a46eb195495455b8602
This commit is contained in:
parent
13fa3e9044
commit
75a0702224
@ -166,21 +166,20 @@ class hybridmanifest(object):
|
||||
|
||||
def _manifest(self, operation):
|
||||
# Get the manifest most suited for the operations (flat or cached)
|
||||
# TODO return fastmanifest when suitable
|
||||
if self.debugfastmanifest:
|
||||
if self.__cachedmanifest:
|
||||
return self.__cachedmanifest
|
||||
|
||||
flatmanifest = self._flatmanifest().text()
|
||||
fm = fastmanifest_wrapper.fastManifest(flatmanifest)
|
||||
self.__cachedmanifest = fastmanifestdict(fm)
|
||||
return self.__cachedmanifest
|
||||
|
||||
# TODO: return fastmanifest when suitable
|
||||
c = self._cachedmanifest()
|
||||
if c is not None:
|
||||
return c
|
||||
|
||||
r = self._flatmanifest()
|
||||
|
||||
if self.debugfastmanifest:
|
||||
# in debug mode, we always convert into a fastmanifest.
|
||||
fm = fastmanifest_wrapper.fastManifest(r.text())
|
||||
self.__cachedmanifest = fastmanifestdict(fm)
|
||||
self.incache = True
|
||||
return self.__cachedmanifest
|
||||
|
||||
return r
|
||||
|
||||
# Proxy all the manifest methods to the flatmanifest except magic methods
|
||||
|
Loading…
Reference in New Issue
Block a user