diff mercurial/bundlecaches.py @ 50530:f4a540c203d7

stream-clone: support streamv3 on the cli [hg bundle] We add support and test for this. The support is still experimental, so the various name and identifier will eventually need to be renamed when stream-v3 gets out of experimental.
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Tue, 23 May 2023 01:39:47 +0200
parents f2bcb56a1d39
children e6948aafda6f
line wrap: on
line diff
--- a/mercurial/bundlecaches.py	Tue May 23 01:28:56 2023 +0200
+++ b/mercurial/bundlecaches.py	Tue May 23 01:39:47 2023 +0200
@@ -100,6 +100,15 @@
         b'tagsfnodescache': False,
         b'revbranchcache': False,
     },
+    b'streamv3-exp': {
+        b'changegroup': False,
+        b'cg.version': b'03',
+        b'obsolescence': False,
+        b'phases': False,
+        b"streamv3-exp": True,
+        b'tagsfnodescache': False,
+        b'revbranchcache': False,
+    },
     b'packed1': {
         b'cg.version': b's1',
     },
@@ -278,8 +287,10 @@
         # warning when the old way is encountered)
         if params[b"stream"] == b"v2":
             version = b"streamv2"
+        if params[b"stream"] == b"v3-exp":
+            version = b"streamv3-exp"
     contentopts = _bundlespeccontentopts.get(version, {}).copy()
-    if version == b"streamv2":
+    if version == b"streamv2" or version == b"streamv3-exp":
         # streamv2 have been reported as "v2" for a while.
         version = b"v2"
 
@@ -337,7 +348,10 @@
     if (
         bundlespec.wirecompression == b'UN'
         and bundlespec.wireversion == b'02'
-        and bundlespec.contentopts.get(b'streamv2')
+        and (
+            bundlespec.contentopts.get(b'streamv2')
+            or bundlespec.contentopts.get(b'streamv3-exp')
+        )
     ):
         return True