[PATCH 4 of 8] changegroup: use '1' for changegroup packer version 1

Sune Foldager sune.foldager at me.com
Fri Oct 17 08:14:55 CDT 2014


# HG changeset patch
# User Sune Foldager <cryo at cyanite.org>
# Date 1413549654 -7200
#      Fri Oct 17 14:40:54 2014 +0200
# Node ID a95c01e22321a83e2a2271aeab4b53434b81edd9
# Parent  a26075a46a0da39db23d6dcefb4e1937da8d7bc2
changegroup: use '1' for changegroup packer version 1

Using 'HG10' risks conflating bundle formats (HG10 and HG2X)
with changegroup formats (currently just 1). Note that HG10 is
the same as a changegroup in format 1, but HG2X is more general.

This patch should probably be folded with the one introducing packermap.

diff -r a26075a46a0d -r a95c01e22321 mercurial/bundle2.py
--- a/mercurial/bundle2.py	Wed Sep 24 21:33:12 2014 -0700
+++ b/mercurial/bundle2.py	Fri Oct 17 14:40:54 2014 +0200
@@ -820,7 +820,7 @@
     # we need to make sure we trigger the creation of a transaction object used
     # for the whole processing scope.
     op.gettransaction()
-    unpackerversion = inpart.params.get('version', 'HG10')
+    unpackerversion = inpart.params.get('version', '1')
     # We should raise an appropriate exception here
     unpacker = changegroup.packermap[unpackerversion][1]
     cg = unpacker(inpart, 'UN')
diff -r a26075a46a0d -r a95c01e22321 mercurial/changegroup.py
--- a/mercurial/changegroup.py	Wed Sep 24 21:33:12 2014 -0700
+++ b/mercurial/changegroup.py	Fri Oct 17 14:40:54 2014 +0200
@@ -433,7 +433,7 @@
         # 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)}
+packermap = {'1': (cg1packer, cg1unpacker)}
 
 def _changegroupinfo(repo, nodes, source):
     if repo.ui.verbose or source == 'bundle':


More information about the Mercurial-devel mailing list