changeset 34293:0fe62d8bdd50

bundlerepo: update to use new deltaiter api Differential Revision: https://phab.mercurial-scm.org/D745
author Durham Goode <durham@fb.com>
date Wed, 20 Sep 2017 09:39:03 -0700
parents 311f6ccf8f23
children 05131c963767
files mercurial/bundlerepo.py
diffstat 1 files changed, 2 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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):