mercurial/commands.py
changeset 24686 e0e28e910fa3
parent 24663 7d01371e6358
child 24698 a85c4ed1132f
equal deleted inserted replaced
24685:b3d78d82d84c 24686:e0e28e910fa3
  1219 
  1219 
  1220     bundletype = opts.get('type', 'bzip2').lower()
  1220     bundletype = opts.get('type', 'bzip2').lower()
  1221     btypes = {'none': 'HG10UN',
  1221     btypes = {'none': 'HG10UN',
  1222               'bzip2': 'HG10BZ',
  1222               'bzip2': 'HG10BZ',
  1223               'gzip': 'HG10GZ',
  1223               'gzip': 'HG10GZ',
  1224               'bundle2': 'HG2Y'}
  1224               'bundle2': 'HG20'}
  1225     bundletype = btypes.get(bundletype)
  1225     bundletype = btypes.get(bundletype)
  1226     if bundletype not in changegroup.bundletypes:
  1226     if bundletype not in changegroup.bundletypes:
  1227         raise util.Abort(_('unknown bundle type specified with --type'))
  1227         raise util.Abort(_('unknown bundle type specified with --type'))
  1228 
  1228 
  1229     if opts.get('all'):
  1229     if opts.get('all'):
  1916     if not isinstance(gen, bundle2.unbundle20):
  1916     if not isinstance(gen, bundle2.unbundle20):
  1917         raise util.Abort(_('not a bundle2 file'))
  1917         raise util.Abort(_('not a bundle2 file'))
  1918     ui.write(('Stream params: %s\n' % repr(gen.params)))
  1918     ui.write(('Stream params: %s\n' % repr(gen.params)))
  1919     for part in gen.iterparts():
  1919     for part in gen.iterparts():
  1920         ui.write('%s -- %r\n' % (part.type, repr(part.params)))
  1920         ui.write('%s -- %r\n' % (part.type, repr(part.params)))
  1921         if part.type == 'b2x:changegroup':
  1921         if part.type == 'changegroup':
  1922             version = part.params.get('version', '01')
  1922             version = part.params.get('version', '01')
  1923             cg = changegroup.packermap[version][1](part, 'UN')
  1923             cg = changegroup.packermap[version][1](part, 'UN')
  1924             chunkdata = cg.changelogheader()
  1924             chunkdata = cg.changelogheader()
  1925             chain = None
  1925             chain = None
  1926             while True:
  1926             while True:
  2209 
  2209 
  2210     bundletype = opts.get('type', 'bzip2').lower()
  2210     bundletype = opts.get('type', 'bzip2').lower()
  2211     btypes = {'none': 'HG10UN',
  2211     btypes = {'none': 'HG10UN',
  2212               'bzip2': 'HG10BZ',
  2212               'bzip2': 'HG10BZ',
  2213               'gzip': 'HG10GZ',
  2213               'gzip': 'HG10GZ',
  2214               'bundle2': 'HG2Y'}
  2214               'bundle2': 'HG20'}
  2215     bundletype = btypes.get(bundletype)
  2215     bundletype = btypes.get(bundletype)
  2216     if bundletype not in changegroup.bundletypes:
  2216     if bundletype not in changegroup.bundletypes:
  2217         raise util.Abort(_('unknown bundle type specified with --type'))
  2217         raise util.Abort(_('unknown bundle type specified with --type'))
  2218     changegroup.writebundle(ui, bundle, bundlepath, bundletype)
  2218     changegroup.writebundle(ui, bundle, bundlepath, bundletype)
  2219 
  2219