changeset 28667:e7bf227e33a5

exchange: get rid of "getcgkwargs" variable This also makes the "version" argument explicit (never relies on getlocalchangegroupraw()'s default), which I think is a good thing.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 25 Mar 2016 16:01:40 -0700
parents ae53ecc47414
children 07f1fbf1f758
files mercurial/exchange.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/exchange.py	Mon Mar 28 14:41:29 2016 -0700
+++ b/mercurial/exchange.py	Fri Mar 25 16:01:40 2016 -0700
@@ -1559,23 +1559,22 @@
     cg = None
     if kwargs.get('cg', True):
         # build changegroup bundle here.
-        version = None
+        version = '01'
         cgversions = b2caps.get('changegroup')
-        getcgkwargs = {}
         if cgversions:  # 3.1 and 3.2 ship with an empty value
             cgversions = [v for v in cgversions
                           if v in changegroup.supportedoutgoingversions(repo)]
             if not cgversions:
                 raise ValueError(_('no common changegroup version'))
-            version = getcgkwargs['version'] = max(cgversions)
+            version = max(cgversions)
         outgoing = changegroup.computeoutgoing(repo, heads, common)
         cg = changegroup.getlocalchangegroupraw(repo, source, outgoing,
                                                 bundlecaps=bundlecaps,
-                                                **getcgkwargs)
+                                                version=version)
 
     if cg:
         part = bundler.newpart('changegroup', data=cg)
-        if version is not None:
+        if cgversions:
             part.addparam('version', version)
         part.addparam('nbchanges', str(len(outgoing.missing)), mandatory=False)
         if 'treemanifest' in repo.requirements: