# HG changeset patch # User Gregory Szorc # Date 1538509239 25200 # Node ID 83146d176c0346d88ed80cb66294e2029351a1a7 # Parent 7e807b8a9e56760afb7ff90b8120347592d9cde6 localrepo: add repository feature when repo can be stream cloned Right now, the wire protocol server assumes all repository objects can be stream cloned (unless the stream clone feature is disabled via config option). But not all storage backends or repository objects may support stream clone. This commit defines a repository feature denoting whether stream clone is supported. The feature is defined for revlog-based repositories, which should currently be "all repositories." Differential Revision: https://phab.mercurial-scm.org/D4852 diff -r 7e807b8a9e56 -r 83146d176c03 mercurial/localrepo.py --- a/mercurial/localrepo.py Wed Sep 26 18:08:08 2018 -0700 +++ b/mercurial/localrepo.py Tue Oct 02 12:40:39 2018 -0700 @@ -795,6 +795,7 @@ def makefilestorage(requirements, features, **kwargs): """Produce a type conforming to ``ilocalrepositoryfilestorage``.""" features.add(repository.REPO_FEATURE_REVLOG_FILE_STORAGE) + features.add(repository.REPO_FEATURE_STREAM_CLONE) if repository.NARROW_REQUIREMENT in requirements: return revlognarrowfilestorage diff -r 7e807b8a9e56 -r 83146d176c03 mercurial/repository.py --- a/mercurial/repository.py Wed Sep 26 18:08:08 2018 -0700 +++ b/mercurial/repository.py Tue Oct 02 12:40:39 2018 -0700 @@ -27,6 +27,8 @@ REPO_FEATURE_SHARED_STORAGE = b'sharedstore' # LFS supported for backing file storage. REPO_FEATURE_LFS = b'lfs' +# Repository supports being stream cloned. +REPO_FEATURE_STREAM_CLONE = b'streamclone' class ipeerconnection(interfaceutil.Interface): """Represents a "connection" to a repository.