[PATCH 2 of 4] changegroup: add version argument to getchangegroup

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Oct 1 22:32:28 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1443752087 25200
#      Thu Oct 01 19:14:47 2015 -0700
# Node ID 5ae2e2fc8c3e833358725fc1305829d9c1570c25
# Parent  e93790d473f2a876ffb50101ba8dfc0dc71e15f5
changegroup: add version argument to getchangegroup

For some obscure reasons (probably upsetting a Greek goddess),
getchangegroup 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
@@ -643,21 +643,23 @@ def computeoutgoing(repo, heads, common)
         common = [nullid]
     if not heads:
         heads = cl.heads()
     return discovery.outgoing(cl, common, heads)
 
-def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None):
+def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None,
+                   version='01'):
     """Like changegroupsubset, but returns the set difference between the
     ancestors of heads and the ancestors common.
 
     If heads is None, use the local heads. If common is None, use [nullid].
 
     The nodes in common might not all be known locally due to the way the
     current discovery protocol works.
     """
     outgoing = computeoutgoing(repo, heads, common)
-    return getlocalchangegroup(repo, source, outgoing, bundlecaps=bundlecaps)
+    return getlocalchangegroup(repo, source, outgoing, bundlecaps=bundlecaps,
+                               version=version)
 
 def changegroup(repo, basenodes, source):
     # to avoid a race we use changegroupsubset() (issue1320)
     return changegroupsubset(repo, basenodes, repo.heads(), source)
 


More information about the Mercurial-devel mailing list