mercurial/exchange.py
changeset 28668 07f1fbf1f758
parent 28667 e7bf227e33a5
child 28876 79b8f052ee51
equal deleted inserted replaced
28667:e7bf227e33a5 28668:07f1fbf1f758
   699                                      pushop.outgoing)
   699                                      pushop.outgoing)
   700 
   700 
   701     _pushb2ctxcheckheads(pushop, bundler)
   701     _pushb2ctxcheckheads(pushop, bundler)
   702 
   702 
   703     b2caps = bundle2.bundle2caps(pushop.remote)
   703     b2caps = bundle2.bundle2caps(pushop.remote)
   704     version = None
   704     version = '01'
   705     cgversions = b2caps.get('changegroup')
   705     cgversions = b2caps.get('changegroup')
   706     if not cgversions:  # 3.1 and 3.2 ship with an empty value
   706     if cgversions:  # 3.1 and 3.2 ship with an empty value
   707         cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push',
       
   708                                                 pushop.outgoing)
       
   709     else:
       
   710         cgversions = [v for v in cgversions
   707         cgversions = [v for v in cgversions
   711                       if v in changegroup.supportedoutgoingversions(
   708                       if v in changegroup.supportedoutgoingversions(
   712                           pushop.repo)]
   709                           pushop.repo)]
   713         if not cgversions:
   710         if not cgversions:
   714             raise ValueError(_('no common changegroup version'))
   711             raise ValueError(_('no common changegroup version'))
   715         version = max(cgversions)
   712         version = max(cgversions)
   716         cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push',
   713     cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push',
   717                                                 pushop.outgoing,
   714                                             pushop.outgoing,
   718                                                 version=version)
   715                                             version=version)
   719     cgpart = bundler.newpart('changegroup', data=cg)
   716     cgpart = bundler.newpart('changegroup', data=cg)
   720     if version is not None:
   717     if cgversions:
   721         cgpart.addparam('version', version)
   718         cgpart.addparam('version', version)
   722     if 'treemanifest' in pushop.repo.requirements:
   719     if 'treemanifest' in pushop.repo.requirements:
   723         cgpart.addparam('treemanifest', '1')
   720         cgpart.addparam('treemanifest', '1')
   724     def handlereply(op):
   721     def handlereply(op):
   725         """extract addchangegroup returns from server reply"""
   722         """extract addchangegroup returns from server reply"""