revlog: avoid large yields in group()
Split large yields so that the downstream consumer (chunkbuffer) will avoid
some pain when reading ahead.
--- 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()