comparison mercurial/bundlecaches.py @ 50515:f2bcb56a1d39

stream-clone: make sure the `stream` capability is set when bundling This is important to start narrowing protocol option in the next changesets.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 21 May 2023 01:03:19 +0200
parents d68462736492
children f4a540c203d7
comparison
equal deleted inserted replaced
50514:cd2a2963b982 50515:f2bcb56a1d39
267 _(b'missing support for repository features: %s') 267 _(b'missing support for repository features: %s')
268 % b', '.join(sorted(missingreqs)) 268 % b', '.join(sorted(missingreqs))
269 ) 269 )
270 270
271 # Compute contentopts based on the version 271 # Compute contentopts based on the version
272 if b"stream" in params and params[b"stream"] == b"v2": 272 if b"stream" in params:
273 # That case is fishy as this mostly derails the version selection 273 # This case is fishy as this mostly derails the version selection
274 # mechanism. `stream` bundles are quite specific and used differently 274 # mechanism. `stream` bundles are quite specific and used differently
275 # as "normal" bundles. 275 # as "normal" bundles.
276 # 276 #
277 # So we are pinning this to "v2", as this will likely be
278 # compatible forever. (see the next conditional).
279 #
280 # (we should probably define a cleaner way to do this and raise a 277 # (we should probably define a cleaner way to do this and raise a
281 # warning when the old way is encounter) 278 # warning when the old way is encountered)
282 version = b"streamv2" 279 if params[b"stream"] == b"v2":
280 version = b"streamv2"
283 contentopts = _bundlespeccontentopts.get(version, {}).copy() 281 contentopts = _bundlespeccontentopts.get(version, {}).copy()
284 if version == b"streamv2": 282 if version == b"streamv2":
285 # streamv2 have been reported as "v2" for a while. 283 # streamv2 have been reported as "v2" for a while.
286 version = b"v2" 284 version = b"v2"
287 285