# HG changeset patch # User Gregory Szorc # Date 2015-10-03 04:53:25 # Node ID 591088f7028a1b1538684270f1189a3afa48f932 # Parent 3ea10bb761ce997754a5be57bded36046920c156 streamclone: add explicit check for empty local repo Stream clone doesn't work with non-empty local repositories. In upcoming patches, we'll move stream cloning to the regular pull code path. Add an explicit check on the repository being empty to prevent streaming clones to non-empty repos. diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py --- a/mercurial/streamclone.py +++ b/mercurial/streamclone.py @@ -25,6 +25,10 @@ def canperformstreamclone(repo, remote, a set of repo requirements from the remote, or ``None`` if stream clone isn't supported. """ + # Streaming clone only works on empty repositories. + if len(repo): + return False, None + # Streaming clone only works if all data is being requested. if heads: return False, None