[PATCH 2 of 8] bundle2caps: advertises the available versions for changegroup packer

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


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1411619334 25200
#      Wed Sep 24 21:28:54 2014 -0700
# Node ID 9280656032da93b18a28333506f19e394ed2680a
# Parent  e4f93393a4e62d3d8fd4e26acfde28d1abef11f1
bundle2caps: advertises the available versions for changegroup packer

This will let bundle2 client and server detect what packer they should be using.

This detection part is not done. I expect it to be done with the addition of the
second packer (with general delta support).

diff -r e4f93393a4e6 -r 9280656032da mercurial/bundle2.py
--- a/mercurial/bundle2.py	Wed Sep 24 21:24:06 2014 -0700
+++ b/mercurial/bundle2.py	Wed Sep 24 21:28:54 2014 -0700
@@ -779,7 +779,6 @@
 capabilities = {'HG2X': (),
                 'b2x:listkeys': (),
                 'b2x:pushkey': (),
-                'b2x:changegroup': (),
                }
 
 def getrepocaps(repo):
@@ -788,6 +787,7 @@
     Exists to allow extensions (like evolution) to mutate the capabilities.
     """
     caps = capabilities.copy()
+    caps['b2x:changegroup'] = tuple(sorted(changegroup.packermap.keys()))
     if obsolete.isenabled(repo, obsolete.exchangeopt):
         supportedformat = tuple('V%i' % v for v in obsolete.formats)
         caps['b2x:obsmarkers'] = supportedformat


More information about the Mercurial-devel mailing list