# HG changeset patch # User Pierre-Yves David # Date 2024-04-02 15:02:39 # Node ID cc44b3df9bb4d6b3e53c3f6e23a42a4a832fbc09 # Parent f1512dbfee9f010ac7217eb6c8f326d343462a24 bundle: do no check the changegroup version if no changegroup is included We don't need to check the compatibility of something we will not use. In practice this was getting in the was of `streamv2` bundles on a narrow repository as the 'cg.version=02' value was rejected by this checks. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1626,6 +1626,8 @@ def bundle(ui, repo, fname, *dests, **op pycompat.bytestr(e), hint=_(b"see 'hg help bundlespec' for supported values for --type"), ) + + has_changegroup = bundlespec.params.get(b"changegroup", False) cgversion = bundlespec.params[b"cg.version"] # Packed bundles are a pseudo bundle format for now. @@ -1662,7 +1664,8 @@ def bundle(ui, repo, fname, *dests, **op base = [nullrev] else: base = None - if cgversion not in changegroup.supportedoutgoingversions(repo): + supported_cg_versions = changegroup.supportedoutgoingversions(repo) + if has_changegroup and cgversion not in supported_cg_versions: raise error.Abort( _(b"repository does not support bundle version %s") % cgversion )