mercurial/commands.py
changeset 37164 b229fd9adeae
parent 37152 0348c778bf70
child 37165 6c7a6b04b274
equal deleted inserted replaced
37163:0fb28899e81a 37164:b229fd9adeae
  1197         if revstrings and not revs:
  1197         if revstrings and not revs:
  1198             raise error.Abort(_('no commits to bundle'))
  1198             raise error.Abort(_('no commits to bundle'))
  1199 
  1199 
  1200     bundletype = opts.get('type', 'bzip2').lower()
  1200     bundletype = opts.get('type', 'bzip2').lower()
  1201     try:
  1201     try:
  1202         bcompression, cgversion, params = exchange.parsebundlespec(
  1202         bundlespec = exchange.parsebundlespec(repo, bundletype, strict=False)
  1203                 repo, bundletype, strict=False)
       
  1204     except error.UnsupportedBundleSpecification as e:
  1203     except error.UnsupportedBundleSpecification as e:
  1205         raise error.Abort(pycompat.bytestr(e),
  1204         raise error.Abort(pycompat.bytestr(e),
  1206                           hint=_("see 'hg help bundlespec' for supported "
  1205                           hint=_("see 'hg help bundlespec' for supported "
  1207                                  "values for --type"))
  1206                                  "values for --type"))
       
  1207     cgversion = bundlespec.version
  1208 
  1208 
  1209     # Packed bundles are a pseudo bundle format for now.
  1209     # Packed bundles are a pseudo bundle format for now.
  1210     if cgversion == 's1':
  1210     if cgversion == 's1':
  1211         raise error.Abort(_('packed bundles cannot be produced by "hg bundle"'),
  1211         raise error.Abort(_('packed bundles cannot be produced by "hg bundle"'),
  1212                           hint=_("use 'hg debugcreatestreamclonebundle'"))
  1212                           hint=_("use 'hg debugcreatestreamclonebundle'"))
  1244 
  1244 
  1245     if not outgoing.missing:
  1245     if not outgoing.missing:
  1246         scmutil.nochangesfound(ui, repo, not base and outgoing.excluded)
  1246         scmutil.nochangesfound(ui, repo, not base and outgoing.excluded)
  1247         return 1
  1247         return 1
  1248 
  1248 
       
  1249     bcompression = bundlespec.compression
  1249     if cgversion == '01': #bundle1
  1250     if cgversion == '01': #bundle1
  1250         if bcompression is None:
  1251         if bcompression is None:
  1251             bcompression = 'UN'
  1252             bcompression = 'UN'
  1252         bversion = 'HG10' + bcompression
  1253         bversion = 'HG10' + bcompression
  1253         bcompression = None
  1254         bcompression = None