mercurial/commands.py
changeset 32150 282b288aa20c
parent 32147 a77e61b45384
child 32165 30b9a7b96448
equal deleted inserted replaced
32149:9a9d54ae9963 32150:282b288aa20c
  1344         if opts.get('base'):
  1344         if opts.get('base'):
  1345             ui.warn(_("ignoring --base because --all was specified\n"))
  1345             ui.warn(_("ignoring --base because --all was specified\n"))
  1346         base = ['null']
  1346         base = ['null']
  1347     else:
  1347     else:
  1348         base = scmutil.revrange(repo, opts.get('base'))
  1348         base = scmutil.revrange(repo, opts.get('base'))
  1349     # TODO: get desired bundlecaps from command line.
       
  1350     bundlecaps = None
       
  1351     if cgversion not in changegroup.supportedoutgoingversions(repo):
  1349     if cgversion not in changegroup.supportedoutgoingversions(repo):
  1352         raise error.Abort(_("repository does not support bundle version %s") %
  1350         raise error.Abort(_("repository does not support bundle version %s") %
  1353                           cgversion)
  1351                           cgversion)
  1354 
  1352 
  1355     if base:
  1353     if base:
  1358                                "a destination"))
  1356                                "a destination"))
  1359         common = [repo.lookup(rev) for rev in base]
  1357         common = [repo.lookup(rev) for rev in base]
  1360         heads = revs and map(repo.lookup, revs) or None
  1358         heads = revs and map(repo.lookup, revs) or None
  1361         outgoing = discovery.outgoing(repo, common, heads)
  1359         outgoing = discovery.outgoing(repo, common, heads)
  1362         cg = changegroup.getchangegroup(repo, 'bundle', outgoing,
  1360         cg = changegroup.getchangegroup(repo, 'bundle', outgoing,
  1363                                         bundlecaps=bundlecaps,
       
  1364                                         version=cgversion)
  1361                                         version=cgversion)
  1365         outgoing = None
  1362         outgoing = None
  1366     else:
  1363     else:
  1367         dest = ui.expandpath(dest or 'default-push', dest or 'default')
  1364         dest = ui.expandpath(dest or 'default-push', dest or 'default')
  1368         dest, branches = hg.parseurl(dest, opts.get('branch'))
  1365         dest, branches = hg.parseurl(dest, opts.get('branch'))
  1372         outgoing = discovery.findcommonoutgoing(repo, other,
  1369         outgoing = discovery.findcommonoutgoing(repo, other,
  1373                                                 onlyheads=heads,
  1370                                                 onlyheads=heads,
  1374                                                 force=opts.get('force'),
  1371                                                 force=opts.get('force'),
  1375                                                 portable=True)
  1372                                                 portable=True)
  1376         cg = changegroup.getlocalchangegroup(repo, 'bundle', outgoing,
  1373         cg = changegroup.getlocalchangegroup(repo, 'bundle', outgoing,
  1377                                                 bundlecaps, version=cgversion)
  1374                                              version=cgversion)
  1378     if not cg:
  1375     if not cg:
  1379         scmutil.nochangesfound(ui, repo, outgoing and outgoing.excluded)
  1376         scmutil.nochangesfound(ui, repo, outgoing and outgoing.excluded)
  1380         return 1
  1377         return 1
  1381 
  1378 
  1382     if cgversion == '01': #bundle1
  1379     if cgversion == '01': #bundle1