diff -r b4074417b661 -r d105195436c0 mercurial/wireproto.py --- a/mercurial/wireproto.py Mon Oct 17 19:48:36 2016 +0200 +++ b/mercurial/wireproto.py Sun Oct 16 11:10:21 2016 -0700 @@ -85,6 +85,14 @@ """ raise NotImplementedError() + def compresschunks(self, chunks): + """Generator of possible compressed chunks to send to the client. + + This is like ``groupchunks()`` except it accepts a generator as + its argument. + """ + raise NotImplementedError() + class remotebatch(peer.batcher): '''batches the queued calls; uses as few roundtrips as possible''' def __init__(self, remote): @@ -773,9 +781,7 @@ return ooberror(bundle2required) chunks = exchange.getbundlechunks(repo, 'serve', **opts) - # TODO avoid util.chunkbuffer() here since it is adding overhead to - # what is fundamentally a generator proxying operation. - return streamres(proto.groupchunks(util.chunkbuffer(chunks))) + return streamres(proto.compresschunks(chunks)) @wireprotocommand('heads') def heads(repo, proto):