146 return br |
146 return br |
147 except: |
147 except: |
148 raise util.UnexpectedOutput(_("unexpected response:"), d) |
148 raise util.UnexpectedOutput(_("unexpected response:"), d) |
149 |
149 |
150 def between(self, pairs): |
150 def between(self, pairs): |
151 n = " ".join(["-".join(map(hex, p)) for p in pairs]) |
151 batch = 8 # avoid giant requests |
152 d = self.do_read("between", pairs=n) |
152 r = [] |
153 try: |
153 for i in xrange(0, len(pairs), batch): |
154 p = [ l and map(bin, l.split(" ")) or [] for l in d.splitlines() ] |
154 n = " ".join(["-".join(map(hex, p)) for p in pairs[i:i + batch]]) |
155 return p |
155 d = self.do_read("between", pairs=n) |
156 except: |
156 try: |
157 raise util.UnexpectedOutput(_("unexpected response:"), d) |
157 r += [ l and map(bin, l.split(" ")) or [] for l in d.splitlines() ] |
|
158 except: |
|
159 raise util.UnexpectedOutput(_("unexpected response:"), d) |
|
160 return r |
158 |
161 |
159 def changegroup(self, nodes, kind): |
162 def changegroup(self, nodes, kind): |
160 n = " ".join(map(hex, nodes)) |
163 n = " ".join(map(hex, nodes)) |
161 f = self.do_cmd("changegroup", roots=n) |
164 f = self.do_cmd("changegroup", roots=n) |
162 return util.chunkbuffer(zgenerator(f)) |
165 return util.chunkbuffer(zgenerator(f)) |