Patchwork [1,of,3,RFC] changegroup: add a "packermap" dictionary to track different packer version

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 25, 2014, 4:36 a.m.
Message ID <7850f829f2b1a731653c.1411619789@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5978/
State Deferred
Headers show

Comments

Pierre-Yves David - Sept. 25, 2014, 4:36 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1411619046 25200
#      Wed Sep 24 21:24:06 2014 -0700
# Node ID 7850f829f2b1a731653c96e78a5acc10300d02a3
# Parent  a24f96a788b3e94a8c93dc259839728a38c2446a
changegroup: add a "packermap" dictionary to track different packer version

We only have one right now (HG10) but we should get general delta in soon.
Bundle2 is expected to make use of this to advertise and select the right packer
to use on both side.
Pierre-Yves David - Sept. 25, 2014, 4:37 a.m.
On 09/24/2014 09:36 PM, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1411619046 25200
> #      Wed Sep 24 21:24:06 2014 -0700
> # Node ID 7850f829f2b1a731653c96e78a5acc10300d02a3
> # Parent  a24f96a788b3e94a8c93dc259839728a38c2446a
> changegroup: add a "packermap" dictionary to track different packer version

This series has not user and should not be queued. It is send mostly to 
help Sune Foldager progress toward having a generaldelta aware changegroup.

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -431,10 +431,12 @@  class cg1packer(object):
         yield delta
     def builddeltaheader(self, node, p1n, p2n, basenode, linknode):
         # do nothing with basenode, it is implicitly the previous one in HG10
         return struct.pack(self.deltaheader, node, p1n, p2n, linknode)
 
+packermap = {'HG10': (cg1packer, cg1unpacker)}
+
 def _changegroupinfo(repo, nodes, source):
     if repo.ui.verbose or source == 'bundle':
         repo.ui.status(_("%d changesets found\n") % len(nodes))
     if repo.ui.debugflag:
         repo.ui.debug("list of changesets:\n")