equal
deleted
inserted
replaced
121 def changegroup(self, nodes): |
121 def changegroup(self, nodes): |
122 n = " ".join(map(hex, nodes)) |
122 n = " ".join(map(hex, nodes)) |
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 |