diff mercurial/bundlerepo.py @ 12335:e21fe9c5fb25

bundle: get rid of chunkiter
author Matt Mackall <mpm@selenic.com>
date Sun, 19 Sep 2010 12:51:54 -0500
parents 44c7dfc2f6a3
children 6277a9469dff
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Sun Sep 19 12:38:44 2010 -0500
+++ b/mercurial/bundlerepo.py	Sun Sep 19 12:51:54 2010 -0500
@@ -33,7 +33,10 @@
         self.bundle = bundle
         self.basemap = {}
         def chunkpositer():
-            for chunk in bundle.chunks():
+            while 1:
+                chunk = bundle.chunk()
+                if not chunk:
+                    break
                 pos = bundle.tell()
                 yield chunk, pos - len(chunk)
         n = len(self)
@@ -230,8 +233,10 @@
                 if not chunk:
                     break
                 self.bundlefilespos[chunk] = self.bundle.tell()
-                for c in self.bundle.chunks():
-                    pass
+                while 1:
+                    c = self.bundle.chunk()
+                    if not c:
+                        break
 
         if f[0] == '/':
             f = f[1:]