D4853: streamclone: don't support stream clone unless repo feature present

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Wed Oct 3 16:51:54 UTC 2018


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4853

AFFECTED FILES
  mercurial/streamclone.py

CHANGE DETAILS

diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py
--- a/mercurial/streamclone.py
+++ b/mercurial/streamclone.py
@@ -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
 



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list