273 |
273 |
274 def stream_out(self): |
274 def stream_out(self): |
275 raise error.Abort(_('cannot perform stream clone against local ' |
275 raise error.Abort(_('cannot perform stream clone against local ' |
276 'peer')) |
276 'peer')) |
277 |
277 |
278 def unbundle(self, cg, heads, url): |
278 def unbundle(self, bundle, heads, url): |
279 """apply a bundle on a repo |
279 """apply a bundle on a repo |
280 |
280 |
281 This function handles the repo locking itself.""" |
281 This function handles the repo locking itself.""" |
282 try: |
282 try: |
283 try: |
283 try: |
284 cg = exchange.readbundle(self.ui, cg, None) |
284 bundle = exchange.readbundle(self.ui, bundle, None) |
285 ret = exchange.unbundle(self._repo, cg, heads, 'push', url) |
285 ret = exchange.unbundle(self._repo, bundle, heads, 'push', url) |
286 if util.safehasattr(ret, 'getchunks'): |
286 if util.safehasattr(ret, 'getchunks'): |
287 # This is a bundle20 object, turn it into an unbundler. |
287 # This is a bundle20 object, turn it into an unbundler. |
288 # This little dance should be dropped eventually when the |
288 # This little dance should be dropped eventually when the |
289 # API is finally improved. |
289 # API is finally improved. |
290 stream = util.chunkbuffer(ret.getchunks()) |
290 stream = util.chunkbuffer(ret.getchunks()) |