diff mercurial/bundle2.py @ 34101:5ede882c249c

changegroup: replace getchangegroup with makechangegroup As part of reducing the number of changegroup creation APIs, let's replace getchangegroup with calls to makechangegroup. This is mostly a drop in replacement, but it does change the version specifier to be required, so it's more obvious which callers are creating old version 1 changegroups still. Differential Revision: https://phab.mercurial-scm.org/D669
author Durham Goode <durham@fb.com>
date Sun, 10 Sep 2017 18:50:12 -0700
parents 891118dcd279
children e9e0e1143fc5
line wrap: on
line diff
--- a/mercurial/bundle2.py	Sun Sep 10 18:48:42 2017 -0700
+++ b/mercurial/bundle2.py	Sun Sep 10 18:50:12 2017 -0700
@@ -1393,7 +1393,7 @@
 def writenewbundle(ui, repo, source, filename, bundletype, outgoing, opts,
                    vfs=None, compression=None, compopts=None):
     if bundletype.startswith('HG10'):
-        cg = changegroup.getchangegroup(repo, source, outgoing, version='01')
+        cg = changegroup.makechangegroup(repo, outgoing, '01', source)
         return writebundle(ui, cg, filename, bundletype, vfs=vfs,
                            compression=compression, compopts=compopts)
     elif not bundletype.startswith('HG20'):
@@ -1421,8 +1421,7 @@
     cgversion = opts.get('cg.version')
     if cgversion is None:
         cgversion = changegroup.safeversion(repo)
-    cg = changegroup.getchangegroup(repo, source, outgoing,
-                                    version=cgversion)
+    cg = changegroup.makechangegroup(repo, outgoing, cgversion, source)
     part = bundler.newpart('changegroup', data=cg.getchunks())
     part.addparam('version', cg.version)
     if 'clcount' in cg.extras: