changeset 40029: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 83146d176c03
children e2697acd9381
files mercurial/streamclone.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/streamclone.py	Tue Oct 02 12:40:39 2018 -0700
+++ b/mercurial/streamclone.py	Tue Oct 02 12:43:54 2018 -0700
@@ -18,6 +18,7 @@
     error,
     phases,
     pycompat,
+    repository,
     store,
     util,
 )
@@ -178,6 +179,9 @@
 
 def allowservergeneration(repo):
     """Whether streaming clones are allowed from the server."""
+    if repository.REPO_FEATURE_STREAM_CLONE not in repo.features:
+        return False
+
     if not repo.ui.configbool('server', 'uncompressed', untrusted=True):
         return False