bundle2: use cg?unpacker.apply() instead of changegroup.addchangegroup()
authorAugie Fackler <augie@google.com>
Tue, 13 Oct 2015 17:11:52 -0400
changeset 26698 c94cdeeb586a
parent 26697 008761affe3f
child 26699 76f20fc8d54d
bundle2: use cg?unpacker.apply() instead of changegroup.addchangegroup()
mercurial/bundle2.py
--- a/mercurial/bundle2.py	Tue Oct 13 17:11:18 2015 -0400
+++ b/mercurial/bundle2.py	Tue Oct 13 17:11:52 2015 -0400
@@ -1271,8 +1271,7 @@
     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 @@
     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