mercurial/streamclone.py
changeset 50522 58e4842fbfc1
parent 50521 f697af015683
child 50523 a6543983b8f4
--- a/mercurial/streamclone.py	Sat May 20 01:19:26 2023 +0200
+++ b/mercurial/streamclone.py	Sat May 20 01:22:49 2023 +0200
@@ -69,6 +69,16 @@
     repo = pullop.repo
     remote = pullop.remote
 
+    # should we consider streaming clone at all ?
+    streamrequested = pullop.streamclonerequested
+    # If we don't have a preference, let the server decide for us. This
+    # likely only comes into play in LANs.
+    if streamrequested is None:
+        # The server can advertise whether to prefer streaming clone.
+        streamrequested = remote.capable(b'stream-preferred')
+    if not streamrequested:
+        return False, None
+
     # Streaming clone only works on an empty destination repository
     if len(repo):
         return False, None
@@ -92,17 +102,6 @@
     elif bundle2 and not bundle2supported:
         return False, None
 
-    streamrequested = pullop.streamclonerequested
-
-    # If we don't have a preference, let the server decide for us. This
-    # likely only comes into play in LANs.
-    if streamrequested is None:
-        # The server can advertise whether to prefer streaming clone.
-        streamrequested = remote.capable(b'stream-preferred')
-
-    if not streamrequested:
-        return False, None
-
     # In order for stream clone to work, the client has to support all the
     # requirements advertised by the server.
     #