diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1653,7 +1653,11 @@ def trypullbundlefromurl(ui, repo, url): try: fh = urlmod.open(ui, url) cg = readbundle(ui, fh, 'stream') - changegroup.addchangegroup(repo, cg, 'clonebundles', url) + + if isinstance(cg, bundle2.unbundle20): + bundle2.processbundle(repo, cg, lambda: tr) + else: + changegroup.addchangegroup(repo, cg, 'clonebundles', url) tr.close() return True except urllib2.HTTPError as e: diff --git a/tests/test-clonebundles.t b/tests/test-clonebundles.t --- a/tests/test-clonebundles.t +++ b/tests/test-clonebundles.t @@ -128,7 +128,7 @@ Bundle with partial content works Bundle with full content works - $ hg -R server bundle --type gzip --base null -r tip full.hg + $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg 2 changesets found $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest