Patchwork [07,of,10] exchange: 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 <d823ab4639e3f7a1bb21.1444844072@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/11055/
State Accepted
Headers show

Comments

Augie Fackler - Oct. 14, 2015, 5:34 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1444770749 14400
#      Tue Oct 13 17:12:29 2015 -0400
# Node ID d823ab4639e3f7a1bb21786e98ff0e0866e6521b
# Parent  1b1ed2a1f9fd3601bb7d67af067b6aa66ef5ac49
exchange: use cg?unpacker.apply() instead of changegroup.addchangegroup()

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1245,8 +1245,7 @@  def _pullchangeset(pullop):
                            "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
@@ -1575,7 +1574,7 @@  def unbundle(repo, cg, heads, source, ur
                 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:
@@ -1653,7 +1652,7 @@  def trypullbundlefromurl(ui, repo, url):
             try:
                 fh = urlmod.open(ui, url)
                 cg = readbundle(ui, fh, 'stream')
-                changegroup.addchangegroup(repo, cg, 'clonebundles', url)
+                cg.apply(repo, 'clonebundles', url)
                 tr.close()
                 return True
             except urllib2.HTTPError as e: