[PATCH 1 of 4] changegroup: add version argument to getlocalchangegroup

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Oct 2 03:32:27 UTC 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1443752073 25200
#      Thu Oct 01 19:14:33 2015 -0700
# Node ID e93790d473f2a876ffb50101ba8dfc0dc71e15f5
# Parent  97dc6ab42aad232c73180dee648685c26662230b
changegroup: add version argument to getlocalchangegroup

For some obscure reasons (probably upsetting a Greek goddess),
getlocalchangegroup did not had a 'version' argument to control the changegroup
version. We fixes this to allow cg02 to be used with 'hg bundle' in the future.

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -613,18 +613,19 @@ def getlocalchangegroupraw(repo, source,
     if not outgoing.missing:
         return None
     bundler = packermap[version][0](repo, bundlecaps)
     return getsubsetraw(repo, outgoing, bundler, source)
 
-def getlocalchangegroup(repo, source, outgoing, bundlecaps=None):
+def getlocalchangegroup(repo, source, outgoing, bundlecaps=None,
+                        version='01'):
     """Like getbundle, but taking a discovery.outgoing as an argument.
 
     This is only implemented for local repos and reuses potentially
     precomputed sets in outgoing."""
     if not outgoing.missing:
         return None
-    bundler = cg1packer(repo, bundlecaps)
+    bundler = packermap[version][0](repo, bundlecaps)
     return getsubset(repo, outgoing, bundler, source)
 
 def computeoutgoing(repo, heads, common):
     """Computes which revs are outgoing given a set of common
     and a set of heads.


More information about the Mercurial-devel mailing list