mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
treemanifest: don't fallback to flat manifests on a treeonly server
Summary: This flow shouldn't ever be hit, but it was exposed by the bug fixed in the previous patch. Let's go ahead and make this code path not fall back to flat manifests if the server is treeonly. Reviewed By: quark-zju, singhsrb Differential Revision: D10156426 fbshipit-source-id: c766bca318712b61fd1b851990849f3d93362c2e
This commit is contained in:
parent
b3e328c903
commit
43c0f47cf5
@ -88,7 +88,7 @@ class shallowcg1packer(changegroup.cg1packer):
|
||||
if not util.safehasattr(repo.manifestlog, "_revlog"):
|
||||
return False
|
||||
|
||||
if repo.ui.configbool("treemanifest", "treeonly"):
|
||||
if treeonly(repo):
|
||||
return False
|
||||
|
||||
revlog = repo.manifestlog._revlog
|
||||
@ -175,7 +175,7 @@ class shallowcg1packer(changegroup.cg1packer):
|
||||
p1node = mfctx.parents[0]
|
||||
p1ctx = mflog[p1node]
|
||||
except LookupError:
|
||||
if not repo.svfs.treemanifestserver:
|
||||
if not repo.svfs.treemanifestserver or treeonly(repo):
|
||||
raise
|
||||
# If we can't find the flat version, look for trees
|
||||
tmfl = mflog.treemanifestlog
|
||||
@ -555,7 +555,6 @@ def cansendtrees(repo, nodes, source=None, bundlecaps=None, b2caps=None):
|
||||
if bundlecaps is None:
|
||||
bundlecaps = set()
|
||||
sendtrees = repo.ui.configbool("treemanifest", "sendtrees")
|
||||
treeonly = repo.ui.configbool("treemanifest", "treeonly")
|
||||
|
||||
def clienthascap(cap):
|
||||
return cap in bundlecaps or "True" in b2caps.get(cap, [])
|
||||
@ -587,7 +586,7 @@ def cansendtrees(repo, nodes, source=None, bundlecaps=None, b2caps=None):
|
||||
# they're doing a push, but that should almost never happen.
|
||||
result = LocalTrees
|
||||
prefetch = LocalTrees
|
||||
if not treeonly:
|
||||
if not treeonly(repo):
|
||||
# If we're sending trees and flats, then we need to prefetch
|
||||
# everything, since when it inspects the flat manifests it will
|
||||
# attempt to access the tree equivalent.
|
||||
@ -608,3 +607,7 @@ def cansendtrees(repo, nodes, source=None, bundlecaps=None, b2caps=None):
|
||||
pass
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def treeonly(repo):
|
||||
return repo.ui.configbool("treemanifest", "treeonly")
|
||||
|
Loading…
Reference in New Issue
Block a user