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

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 2, 2015, 3:32 a.m.
Message ID <e93790d473f2a876ffb5.1443756747@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/10731/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 2, 2015, 3:32 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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.