diff --git a/mercurial/hgweb/protocol.py b/mercurial/hgweb/protocol.py --- a/mercurial/hgweb/protocol.py +++ b/mercurial/hgweb/protocol.py @@ -73,13 +73,13 @@ class webproto(wireproto.abstractserverp val = self.ui.fout.getvalue() self.ui.ferr, self.ui.fout = self.oldio return val - def groupchunks(self, cg): + def groupchunks(self, fh): # Don't allow untrusted settings because disabling compression or # setting a very high compression level could lead to flooding # the server's network or CPU. z = zlib.compressobj(self.ui.configint('server', 'zliblevel', -1)) while True: - chunk = cg.read(32768) + chunk = fh.read(32768) if not chunk: break data = z.compress(chunk) diff --git a/mercurial/sshserver.py b/mercurial/sshserver.py --- a/mercurial/sshserver.py +++ b/mercurial/sshserver.py @@ -68,8 +68,8 @@ class sshserver(wireproto.abstractserver def redirect(self): pass - def groupchunks(self, changegroup): - return iter(lambda: changegroup.read(4096), '') + def groupchunks(self, fh): + return iter(lambda: fh.read(4096), '') def sendresponse(self, v): self.fout.write("%d\n" % len(v)) diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -78,10 +78,11 @@ class abstractserverproto(object): # """ # raise NotImplementedError() - def groupchunks(self, cg): - """return 4096 chunks from a changegroup object + def groupchunks(self, fh): + """Generator of chunks to send to the client. - Some protocols may have compressed the contents.""" + Some protocols may have compressed the contents. + """ raise NotImplementedError() class remotebatch(peer.batcher):