Patchwork D745: bundlerepo: update to use new deltaiter api

login
register
mail settings
Submitter phabricator
Date Sept. 20, 2017, 5:56 p.m.
Message ID <50ac92e8f83fae94fa2ab1d43ba8490c@localhost.localdomain>
Download mbox | patch
Permalink /patch/24063/
State Not Applicable
Headers show

Comments

phabricator - Sept. 20, 2017, 5:56 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0fe62d8bdd50: bundlerepo: update to use new deltaiter api (authored by durham, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D745?vs=1933&id=1944

REVISION DETAIL
  https://phab.mercurial-scm.org/D745

AFFECTED FILES
  mercurial/bundlerepo.py

CHANGE DETAILS




To: durham, #hg-reviewers, martinvonz
Cc: mercurial-devel

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -55,25 +55,16 @@ 
         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
 
             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):