Patchwork [07,of,14] clone: allow bundle2's stream clone with 'server.disablefullbundle'

login
register
mail settings
Submitter Boris Feld
Date Jan. 18, 2018, 11:21 a.m.
Message ID <621de07792b8cbee1741.1516274493@FB>
Download mbox | patch
Permalink /patch/26850/
State Superseded
Headers show

Comments

Boris Feld - Jan. 18, 2018, 11:21 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1516203512 -3600
#      Wed Jan 17 16:38:32 2018 +0100
# Node ID 621de07792b8cbee17413f42be56c1ab0b5ddb7b
# Parent  dcf85b8c86b8e9e55d1393c070fad04fb5de81a7
# EXP-Topic b2-stream
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 621de07792b8
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.

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -854,10 +854,11 @@  def getbundle(repo, proto, others):
         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'))