comparison mercurial/streamclone.py @ 40028:51f10e6d66c7

streamclone: don't support stream clone unless repo feature present This change means custom repository types must opt in to enabling stream clone. This seems reasonable, as stream clones are a very low-level feature that has historically assumed the use of revlogs and the layout of .hg/ that they entail. Differential Revision: https://phab.mercurial-scm.org/D4853
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 02 Oct 2018 12:43:54 -0700
parents d89d5bc06eaa
children af62936c2508
comparison
equal deleted inserted replaced
40027:83146d176c03 40028:51f10e6d66c7
16 branchmap, 16 branchmap,
17 cacheutil, 17 cacheutil,
18 error, 18 error,
19 phases, 19 phases,
20 pycompat, 20 pycompat,
21 repository,
21 store, 22 store,
22 util, 23 util,
23 ) 24 )
24 25
25 def canperformstreamclone(pullop, bundle2=False): 26 def canperformstreamclone(pullop, bundle2=False):
176 177
177 repo.invalidate() 178 repo.invalidate()
178 179
179 def allowservergeneration(repo): 180 def allowservergeneration(repo):
180 """Whether streaming clones are allowed from the server.""" 181 """Whether streaming clones are allowed from the server."""
182 if repository.REPO_FEATURE_STREAM_CLONE not in repo.features:
183 return False
184
181 if not repo.ui.configbool('server', 'uncompressed', untrusted=True): 185 if not repo.ui.configbool('server', 'uncompressed', untrusted=True):
182 return False 186 return False
183 187
184 # The way stream clone works makes it impossible to hide secret changesets. 188 # The way stream clone works makes it impossible to hide secret changesets.
185 # So don't allow this by default. 189 # So don't allow this by default.