changeset 35760:133a678673cb

clone: allow bundle2's stream clone with 'server.disablefullbundle' The previous check was a bit too strict and would not recognize a get bundle not requesting changegroup.
author Boris Feld <boris.feld@octobus.net>
date Wed, 17 Jan 2018 16:38:32 +0100
parents c24dad55ac19
children 1908d360f977
files mercurial/wireproto.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/wireproto.py	Wed Jan 17 16:36:23 2018 +0100
+++ b/mercurial/wireproto.py	Wed Jan 17 16:38:32 2018 +0100
@@ -866,10 +866,11 @@
         if repo.ui.configbool('server', 'disablefullbundle'):
             # Check to see if this is a full clone.
             clheads = set(repo.changelog.heads())
+            changegroup = opts.get('cg', True)
             heads = set(opts.get('heads', set()))
             common = set(opts.get('common', set()))
             common.discard(nullid)
-            if not common and clheads == heads:
+            if changegroup and not common and clheads == heads:
                 raise error.Abort(
                     _('server has pull-based clones disabled'),
                     hint=_('remove --pull if specified or upgrade Mercurial'))