# HG changeset patch # User Pierre-Yves David # Date 1712070159 -7200 # 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 -r f1512dbfee9f -r cc44b3df9bb4 mercurial/commands.py --- a/mercurial/commands.py Wed Mar 27 18:51:33 2024 +0000 +++ b/mercurial/commands.py Tue Apr 02 17:02:39 2024 +0200 @@ -1626,6 +1626,8 @@ 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 @@ 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 )