bundle2: require both client and server to opt in
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 17 Apr 2014 16:04:58 -0400
changeset 21148 468cd774aa22
parent 21147 2a246e737f92
child 21149 c0d96bceadc2
bundle2: require both client and server to opt in Even if the server is bundle2-enabled, the client now has to opt-in in the config too.
mercurial/exchange.py
mercurial/wireproto.py
--- a/mercurial/exchange.py	Thu Apr 17 16:01:58 2014 -0400
+++ b/mercurial/exchange.py	Thu Apr 17 16:04:58 2014 -0400
@@ -132,7 +132,9 @@
                 pushop.repo.prepushoutgoinghooks(pushop.repo,
                                                  pushop.remote,
                                                  pushop.outgoing)
-                if pushop.remote.capable('bundle2-exp'):
+                if (pushop.repo.ui.configbool('experimental', 'bundle2-exp',
+                                              False)
+                    and pushop.remote.capable('bundle2-exp')):
                     _pushbundle2(pushop)
                 else:
                     _pushchangeset(pushop)
@@ -516,7 +518,8 @@
     lock = pullop.repo.lock()
     try:
         _pulldiscovery(pullop)
-        if pullop.remote.capable('bundle2-exp'):
+        if (pullop.repo.ui.configbool('server', 'bundle2', False)
+            and pullop.remote.capable('bundle2-exp')):
             _pullbundle2(pullop)
         if 'changegroup' in pullop.todosteps:
             _pullchangeset(pullop)
--- a/mercurial/wireproto.py	Thu Apr 17 16:01:58 2014 -0400
+++ b/mercurial/wireproto.py	Thu Apr 17 16:04:58 2014 -0400
@@ -585,7 +585,7 @@
         # otherwise, add 'streamreqs' detailing our local revlog format
         else:
             caps.append('streamreqs=%s' % ','.join(requiredformats))
-    if self.ui.configbool('experimental', 'bundle2-exp', False):
+    if repo.ui.configbool('experimental', 'bundle2-exp', False):
         capsblob = bundle2.encodecaps(repo.bundle2caps)
         caps.append('bundle2-exp=' + urllib.quote(capsblob))
     caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))