215 bases = " ".join(map(hex, bases)) |
215 bases = " ".join(map(hex, bases)) |
216 heads = " ".join(map(hex, heads)) |
216 heads = " ".join(map(hex, heads)) |
217 return self.do_cmd("changegroupsubset", bases=bases, heads=heads) |
217 return self.do_cmd("changegroupsubset", bases=bases, heads=heads) |
218 |
218 |
219 def unbundle(self, cg, heads, source): |
219 def unbundle(self, cg, heads, source): |
|
220 '''Send cg (a readable file-like object representing the |
|
221 changegroup to push, typically a chunkbuffer object) to the |
|
222 remote server as a bundle. Return an integer indicating the |
|
223 result of the push (see localrepository.addchangegroup()).''' |
220 d = self.call("unbundle", heads=' '.join(map(hex, heads))) |
224 d = self.call("unbundle", heads=' '.join(map(hex, heads))) |
221 if d: |
225 if d: |
222 # remote may send "unsynced changes" |
226 # remote may send "unsynced changes" |
223 self.abort(error.RepoError(_("push refused: %s") % d)) |
227 self.abort(error.RepoError(_("push refused: %s") % d)) |
224 |
228 |
240 return int(r) |
244 return int(r) |
241 except: |
245 except: |
242 self.abort(error.ResponseError(_("unexpected response:"), r)) |
246 self.abort(error.ResponseError(_("unexpected response:"), r)) |
243 |
247 |
244 def addchangegroup(self, cg, source, url): |
248 def addchangegroup(self, cg, source, url): |
|
249 '''Send a changegroup to the remote server. Return an integer |
|
250 similar to unbundle(). DEPRECATED, since it requires locking the |
|
251 remote.''' |
245 d = self.call("addchangegroup") |
252 d = self.call("addchangegroup") |
246 if d: |
253 if d: |
247 self.abort(error.RepoError(_("push refused: %s") % d)) |
254 self.abort(error.RepoError(_("push refused: %s") % d)) |
248 while 1: |
255 while 1: |
249 d = cg.read(4096) |
256 d = cg.read(4096) |