[PATCH] bundle2: advertise bundle2 by default
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Fri Apr 10 19:57:21 UTC 2015
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1428694893 14400
# Fri Apr 10 15:41:33 2015 -0400
# Node ID aed1e3bc27ddd9c0ee173d85cf08e26c5f256923
# Parent 8cb03825f3a3fe0ae22cf54adec000092a0f262b
bundle2: advertise bundle2 by default
That way, any new server will be ready to accept bundle2 payload. The decision
for the client to use it is still off by default so this is not turning bundle2
everywhere.
We introduce a new kill switch for this in case stuff goes wrong.
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -310,13 +310,11 @@ class localrepository(object):
def _writecaches(self):
if self._revbranchcache:
self._revbranchcache.write()
def _restrictcapabilities(self, caps):
- # bundle2 is not ready for prime time, drop it unless explicitly
- # required by the tests (or some brave tester)
- if self.ui.configbool('experimental', 'bundle2-exp', False):
+ if self.ui.configbool('experimental', 'bundle2-advertise', True):
caps = set(caps)
capsblob = bundle2.encodecaps(bundle2.getrepocaps(self))
caps.add('bundle2=' + urllib.quote(capsblob))
return caps
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -613,11 +613,11 @@ def _capabilities(repo, proto):
if not requiredformats - set(('revlogv1',)):
caps.append('stream')
# otherwise, add 'streamreqs' detailing our local revlog format
else:
caps.append('streamreqs=%s' % ','.join(requiredformats))
- if repo.ui.configbool('experimental', 'bundle2-exp', False):
+ if repo.ui.configbool('experimental', 'bundle2-advertise', True):
capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo))
caps.append('bundle2=' + urllib.quote(capsblob))
caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
caps.append('httpheader=1024')
return caps
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -1870,11 +1870,11 @@ raw graph
capabilities
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'; echo
200 Script output follows
- lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
+ lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
heads
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=heads'
200 Script output follows
@@ -2050,11 +2050,11 @@ Graph json escape of multibyte character
capabilities
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'; echo
200 Script output follows
- lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream-preferred stream unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
+ lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream-preferred stream bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
heads
ERRORS ENCOUNTERED
More information about the Mercurial-devel
mailing list