bundlerepo: update to use new deltaiter api
authorDurham Goode <durham@fb.com>
Wed, 20 Sep 2017 09:39:03 -0700
changeset 34300 0fe62d8bdd50
parent 34299 311f6ccf8f23
child 34301 05131c963767
bundlerepo: update to use new deltaiter api Differential Revision: https://phab.mercurial-scm.org/D745
mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py	Wed Sep 20 09:28:30 2017 -0700
+++ b/mercurial/bundlerepo.py	Wed Sep 20 09:39:03 2017 -0700
@@ -55,17 +55,9 @@
         self.bundle = bundle
         n = len(self)
         self.repotiprev = n - 1
-        chain = None
         self.bundlerevs = set() # used by 'bundle()' revset expression
-        getchunk = lambda: bundle.deltachunk(chain)
-        for chunkdata in iter(getchunk, {}):
-            node = chunkdata['node']
-            p1 = chunkdata['p1']
-            p2 = chunkdata['p2']
-            cs = chunkdata['cs']
-            deltabase = chunkdata['deltabase']
-            delta = chunkdata['delta']
-            flags = chunkdata['flags']
+        for deltadata in bundle.deltaiter():
+            node, p1, p2, cs, deltabase, delta, flags = deltadata
 
             size = len(delta)
             start = bundle.tell() - size
@@ -73,7 +65,6 @@
             link = linkmapper(cs)
             if node in self.nodemap:
                 # this can happen if two branches make the same change
-                chain = node
                 self.bundlerevs.add(self.nodemap[node])
                 continue
 
@@ -93,7 +84,6 @@
             self.index.insert(-1, e)
             self.nodemap[node] = n
             self.bundlerevs.add(n)
-            chain = node
             n += 1
 
     def _chunk(self, rev):