mercurial/hgweb/protocol.py
changeset 11623 31d0a6d50ee2
parent 11622 1d48681b17a4
child 11625 cdeb861335d5
--- a/mercurial/hgweb/protocol.py	Fri Jul 16 18:18:35 2010 +0200
+++ b/mercurial/hgweb/protocol.py	Fri Jul 16 22:20:10 2010 +0200
@@ -35,22 +35,21 @@
     def redirect(self):
         self.oldio = sys.stdout, sys.stderr
         sys.stderr = sys.stdout = cStringIO.StringIO()
-    def sendresponse(self, s):
-        self.req.respond(HTTP_OK, HGTYPE, length=len(s))
-        self.response = s
-    def sendchangegroup(self, cg):
-        self.req.respond(HTTP_OK, HGTYPE)
+    def groupchunks(self, cg):
         z = zlib.compressobj()
         while 1:
             chunk = cg.read(4096)
             if not chunk:
                 break
-            self.req.write(z.compress(chunk))
-        self.req.write(z.flush())
+            yield z.compress(chunk)
+        yield z.flush()
+    def sendresponse(self, s):
+        self.req.respond(HTTP_OK, HGTYPE, length=len(s))
+        self.response = s
     def sendstream(self, source):
         self.req.respond(HTTP_OK, HGTYPE)
         for chunk in source:
-            self.req.write(chunk)
+            self.req.write(str(chunk))
     def sendpushresponse(self, ret):
         val = sys.stdout.getvalue()
         sys.stdout, sys.stderr = self.oldio