[PATCH 07 of 10] exchange: use cg?unpacker.apply() instead of changegroup.addchangegroup()

Augie Fackler raf at durin42.com
Wed Oct 14 12:34:32 CDT 2015


# HG changeset patch
# User Augie Fackler <augie at 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()

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:


More information about the Mercurial-devel mailing list