mercurial/bundlecaches.py
branchstable
changeset 53028 89ab2459f62a
parent 52957 961900fbd67c
child 53031 e705fec4a03f
equal deleted inserted replaced
53014:0570351db4e7 53028:89ab2459f62a
   321     # The specification for stream bundles can optionally declare the data formats
   321     # The specification for stream bundles can optionally declare the data formats
   322     # required to apply it. If we see this metadata, compare against what the
   322     # required to apply it. If we see this metadata, compare against what the
   323     # repo supports and error if the bundle isn't compatible.
   323     # repo supports and error if the bundle isn't compatible.
   324     if b'requirements' in params:
   324     if b'requirements' in params:
   325         requirements = set(cast(bytes, params[b'requirements']).split(b','))
   325         requirements = set(cast(bytes, params[b'requirements']).split(b','))
   326         missingreqs = requirements - requirementsmod.STREAM_FIXED_REQUIREMENTS
   326         relevant_reqs = (
   327         if missingreqs:
   327             requirements - requirementsmod.STREAM_IGNORABLE_REQUIREMENTS
       
   328         )
       
   329         # avoid cycle (not great for pytype)
       
   330         from . import localrepo
       
   331 
       
   332         supported_req = localrepo.gathersupportedrequirements(repo.ui)
       
   333         missing_reqs = relevant_reqs - supported_req
       
   334         if missing_reqs:
   328             raise error.UnsupportedBundleSpecification(
   335             raise error.UnsupportedBundleSpecification(
   329                 _(b'missing support for repository features: %s')
   336                 _(b'missing support for repository features: %s')
   330                 % b', '.join(sorted(missingreqs))
   337                 % b', '.join(sorted(missing_reqs))
   331             )
   338             )
   332 
   339 
   333     # Compute contentopts based on the version
   340     # Compute contentopts based on the version
   334     if b"stream" in params:
   341     if b"stream" in params:
   335         # This case is fishy as this mostly derails the version selection
   342         # This case is fishy as this mostly derails the version selection