diff -r 76f20fc8d54d -r dbc3d945ba36 mercurial/exchange.py --- a/mercurial/exchange.py Tue Oct 13 17:12:12 2015 -0400 +++ b/mercurial/exchange.py Tue Oct 13 17:12:29 2015 -0400 @@ -1262,8 +1262,7 @@ "changegroupsubset.")) else: cg = pullop.remote.changegroupsubset(pullop.fetch, pullop.heads, 'pull') - pullop.cgresult = changegroup.addchangegroup(pullop.repo, cg, 'pull', - pullop.remote.url()) + pullop.cgresult = cg.apply(pullop.repo, 'pull', pullop.remote.url()) def _pullphase(pullop): # Get remote phases data from remote @@ -1592,7 +1591,7 @@ raise else: lockandtr[1] = repo.lock() - r = changegroup.addchangegroup(repo, cg, source, url) + r = cg.apply(repo, source, url) finally: lockmod.release(lockandtr[2], lockandtr[1], lockandtr[0]) if recordout is not None: @@ -1786,7 +1785,7 @@ if isinstance(cg, bundle2.unbundle20): bundle2.processbundle(repo, cg, lambda: tr) else: - changegroup.addchangegroup(repo, cg, 'clonebundles', url) + cg.apply(repo, 'clonebundles', url) tr.close() return True except urllib2.HTTPError as e: