Mercurial > public > mercurial-scm > hg-stable
diff mercurial/bundlecaches.py @ 50552: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 |
line wrap: on
line diff
--- 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.