comparison mercurial/localrepo.py @ 37646:72e26319f3b8

wireproto: use command executor for unbundle This also required unifying the name of the argument because the new API always passes arguments by keyword. I decided to change implementations to "bundle" instead of the interface to "cg" because "bundle" is more appropriate in a modern world. Differential Revision: https://phab.mercurial-scm.org/D3314
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 13 Apr 2018 11:30:44 -0700
parents cc8c06835097
children a168799687e5
comparison
equal deleted inserted replaced
37645:72b0982cd509 37646:72e26319f3b8
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())