Mercurial > hg
diff mercurial/wireprotov1peer.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 |
line wrap: on
line diff
--- a/mercurial/wireprotov1peer.py Thu Apr 12 12:33:07 2018 -0700 +++ b/mercurial/wireprotov1peer.py Fri Apr 13 11:30:44 2018 -0700 @@ -436,7 +436,7 @@ else: return changegroupmod.cg1unpacker(f, 'UN') - def unbundle(self, cg, heads, url): + def unbundle(self, bundle, heads, url): '''Send cg (a readable file-like object representing the changegroup to push, typically a chunkbuffer object) to the remote server as a bundle. @@ -456,9 +456,9 @@ else: heads = wireprototypes.encodelist(heads) - if util.safehasattr(cg, 'deltaheader'): + if util.safehasattr(bundle, 'deltaheader'): # this a bundle10, do the old style call sequence - ret, output = self._callpush("unbundle", cg, heads=heads) + ret, output = self._callpush("unbundle", bundle, heads=heads) if ret == "": raise error.ResponseError( _('push failed:'), output) @@ -472,7 +472,7 @@ self.ui.status(_('remote: '), l) else: # bundle2 push. Send a stream, fetch a stream. - stream = self._calltwowaystream('unbundle', cg, heads=heads) + stream = self._calltwowaystream('unbundle', bundle, heads=heads) ret = bundle2.getunbundler(self.ui, stream) return ret