# HG changeset patch # User Augie Fackler # Date 2015-10-13 21:11:52 # Node ID c94cdeeb586a2f8e65e8e91f88882702a2eebb35 # Parent 008761affe3f1415ddfaa5588a425d606c44a762 bundle2: use cg?unpacker.apply() instead of changegroup.addchangegroup() diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1271,8 +1271,7 @@ def handlechangegroup(op, inpart): nbchangesets = None if 'nbchanges' in inpart.params: nbchangesets = int(inpart.params.get('nbchanges')) - ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2', - expectedtotal=nbchangesets) + ret = cg.apply(op.repo, 'bundle2', 'bundle2', expectedtotal=nbchangesets) op.records.add('changegroup', {'return': ret}) if op.reply is not None: # This is definitely not the final form of this @@ -1341,7 +1340,7 @@ def handleremotechangegroup(op, inpart): if not isinstance(cg, changegroup.cg1unpacker): raise error.Abort(_('%s: not a bundle version 1.0') % util.hidepassword(raw_url)) - ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2') + ret = cg.apply(op.repo, 'bundle2', 'bundle2') op.records.add('changegroup', {'return': ret}) if op.reply is not None: # This is definitely not the final form of this