mercurial/revlog.py
changeset 5448 e038738714fd
parent 5445 64cf1c853674
child 5450 c728424d44c6
--- a/mercurial/revlog.py	Thu Oct 11 00:46:49 2007 -0500
+++ b/mercurial/revlog.py	Thu Oct 11 00:46:51 2007 -0500
@@ -1096,7 +1096,14 @@
                 d = self.revdiff(a, b)
             yield changegroup.chunkheader(len(meta) + len(d))
             yield meta
-            yield d
+            if len(d) > 2**20:
+                pos = 0
+                while pos < len(d):
+                    pos2 = pos + 2 ** 18
+                    yield d[pos:pos2]
+                    pos = pos2
+            else:
+                yield d
 
         yield changegroup.closechunk()