diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1179,6 +1179,16 @@ def _pullbundle2(pullop): # make sure to always includes bookmark data when migrating # `hg incoming --bundle` to using this function. kwargs['listkeys'].append('bookmarks') + + # If this is a full pull / clone and the server supports the clone bundles + # feature, tell the server whether we attempted a clone bundle. The + # presence of this flag indicates the client supports clone bundles. This + # will enable the server to treat clients that support clone bundles + # differently from those that don't. + if (pullop.remote.capable('clonebundles') + and pullop.heads is None and list(pullop.common) == [nullid]): + kwargs['cbattempted'] = pullop.clonebundleattempted + if streaming: pullop.repo.ui.status(_('streaming all changes\n')) elif not pullop.fetch: diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -160,7 +160,8 @@ gboptsmap = {'heads': 'nodes', 'obsmarkers': 'boolean', 'bundlecaps': 'scsv', 'listkeys': 'csv', - 'cg': 'boolean'} + 'cg': 'boolean', + 'cbattempted': 'boolean'} # client side