Patchwork [05,of,10] bundle2: use cg?unpacker.apply() instead of changegroup.addchangegroup()

login
register
mail settings
Submitter Augie Fackler
Date Oct. 14, 2015, 5:34 p.m.
Message ID <6fd04cbc7f36b6d3aad9.1444844070@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/11054/
State Accepted
Headers show

Comments

Augie Fackler - Oct. 14, 2015, 5:34 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1444770712 14400
#      Tue Oct 13 17:11:52 2015 -0400
# Node ID 6fd04cbc7f36b6d3aad99d85db12a97f90919a46
# Parent  0d9362f825f9b8311eef81255f98c5342e2d226f
bundle2: use cg?unpacker.apply() instead of changegroup.addchangegroup()

Patch

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