##// END OF EJS Templates
Fix same performance bug as c3654cfaa77 but for httprepo.py instead.
Eric Hopper -
r1376:524ca4a0 default
parent child Browse files
Show More
@@ -123,23 +123,13 b' class httprepository(remoterepository):'
123 f = self.do_cmd("changegroup", roots=n)
123 f = self.do_cmd("changegroup", roots=n)
124 bytes = 0
124 bytes = 0
125
125
126 class zread:
126 def zgenerator(f):
127 def __init__(self, f):
127 zd = zlib.decompressobj()
128 self.zd = zlib.decompressobj()
128 for chnk in f:
129 self.f = f
129 yield zd.decompress(chnk)
130 self.buf = ""
130 yield zd.flush()
131 def read(self, l):
132 while l > len(self.buf):
133 r = self.f.read(4096)
134 if r:
135 self.buf += self.zd.decompress(r)
136 else:
137 self.buf += self.zd.flush()
138 break
139 d, self.buf = self.buf[:l], self.buf[l:]
140 return d
141
131
142 return zread(f)
132 return util.chunkbuffer(zgenerator(util.filechunkiter(f)))
143
133
144 class httpsrepository(httprepository):
134 class httpsrepository(httprepository):
145 pass
135 pass
General Comments 0
You need to be logged in to leave comments. Login now