Patchwork [2,of,8,V2] bundle2caps: advertises the available versions for changegroup packer

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 17, 2014, 7:56 p.m.
Message ID <df5caaacde8b95b5eda6.1413575786@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/6387/
State Changes Requested
Headers show

Comments

Pierre-Yves David - Oct. 17, 2014, 7:56 p.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 df5caaacde8b95b5eda6ddef48b9bbbec8374a69
# Parent  7571e3b56091ecd772a4b845a1c72cae3a9abf25
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
@@ -806,10 +806,11 @@  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.isenabled(repo, obsolete.exchangeopt):
         supportedformat = tuple('V%i' % v for v in obsolete.formats)
         caps['b2x:obsmarkers'] = supportedformat
     return caps