mercurial/exchange.py
branchstable
changeset 31473 ffed3bf5cd4c
parent 30913 d70971a3ae80
child 31474 10c0ee338535
equal deleted inserted replaced
31277:86cd1f2cfff5 31473:ffed3bf5cd4c
    42                          'v2': '02',
    42                          'v2': '02',
    43                          'packed1': 's1',
    43                          'packed1': 's1',
    44                          'bundle2': '02', #legacy
    44                          'bundle2': '02', #legacy
    45                         }
    45                         }
    46 
    46 
       
    47 # Compression engines allowed in version 1. THIS SHOULD NEVER CHANGE.
       
    48 _bundlespecv1compengines = set(['gzip', 'bzip2', 'none'])
       
    49 
    47 def parsebundlespec(repo, spec, strict=True, externalnames=False):
    50 def parsebundlespec(repo, spec, strict=True, externalnames=False):
    48     """Parse a bundle string specification into parts.
    51     """Parse a bundle string specification into parts.
    49 
    52 
    50     Bundle specifications denote a well-defined bundle/exchange format.
    53     Bundle specifications denote a well-defined bundle/exchange format.
    51     The content of a given specification should not change over time in
    54     The content of a given specification should not change over time in
   136                 compression = 'bzip2'
   139                 compression = 'bzip2'
   137             version = spec
   140             version = spec
   138         else:
   141         else:
   139             raise error.UnsupportedBundleSpecification(
   142             raise error.UnsupportedBundleSpecification(
   140                     _('%s is not a recognized bundle specification') % spec)
   143                     _('%s is not a recognized bundle specification') % spec)
       
   144 
       
   145     # Bundle version 1 only supports a known set of compression engines.
       
   146     if version == 'v1' and compression not in _bundlespecv1compengines:
       
   147         raise error.UnsupportedBundleSpecification(
       
   148             _('compression engine %s is not supported on v1 bundles') %
       
   149             compression)
   141 
   150 
   142     # The specification for packed1 can optionally declare the data formats
   151     # The specification for packed1 can optionally declare the data formats
   143     # required to apply it. If we see this metadata, compare against what the
   152     # required to apply it. If we see this metadata, compare against what the
   144     # repo supports and error if the bundle isn't compatible.
   153     # repo supports and error if the bundle isn't compatible.
   145     if version == 'packed1' and 'requirements' in params:
   154     if version == 'packed1' and 'requirements' in params: