mercurial/bundlecaches.py
changeset 50515 f2bcb56a1d39
parent 50387 d68462736492
child 50530 f4a540c203d7
--- a/mercurial/bundlecaches.py	Sun May 21 00:00:29 2023 +0200
+++ b/mercurial/bundlecaches.py	Sun May 21 01:03:19 2023 +0200
@@ -269,17 +269,15 @@
             )
 
     # Compute contentopts based on the version
-    if b"stream" in params and params[b"stream"] == b"v2":
-        # That case is fishy as this mostly derails the version selection
+    if b"stream" in params:
+        # This case is fishy as this mostly derails the version selection
         # mechanism. `stream` bundles are quite specific and used differently
         # as "normal" bundles.
         #
-        # So we are pinning this to "v2", as this will likely be
-        # compatible forever. (see the next conditional).
-        #
         # (we should probably define a cleaner way to do this and raise a
-        # warning when the old way is encounter)
-        version = b"streamv2"
+        # warning when the old way is encountered)
+        if params[b"stream"] == b"v2":
+            version = b"streamv2"
     contentopts = _bundlespeccontentopts.get(version, {}).copy()
     if version == b"streamv2":
         # streamv2 have been reported as "v2" for a while.