Patchwork [2,of,3,RFC] bundle2caps: advertises the available versions for changegroup packer

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 25, 2014, 4:36 a.m.
Message ID <d77b259843fe058eceef.1411619790@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5979/
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 1411619334 25200
#      Wed Sep 24 21:28:54 2014 -0700
# Node ID d77b259843fe058eceef0e56fc05959b17b3a961
# Parent  7850f829f2b1a731653c96e78a5acc10300d02a3
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).

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -777,19 +777,19 @@  class unbundlepart(unpackermixin):
         return data
 
 capabilities = {'HG2X': (),
                 'b2x:listkeys': (),
                 'b2x:pushkey': (),
-                'b2x:changegroup': (),
                }
 
 def getrepocaps(repo):
     """return the bundle2 capabilities for a given repo
 
     Exists to allow extensions (like evolution) to mutate the capabilities.
     """
     caps = capabilities.copy()
+    caps['b2x:changegroup'] = tuple(sorted(changegroup.packermap.keys()))
     if obsolete._enabled:
         supportedformat = tuple('V%i' % v for v in obsolete.formats)
         caps['b2x:obsmarkers'] = supportedformat
     return caps