diff mercurial/exchange.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 516b5a5edae3
line wrap: on
line diff
--- a/mercurial/exchange.py	Thu Apr 12 12:33:07 2018 -0700
+++ b/mercurial/exchange.py	Fri Apr 13 11:30:44 2018 -0700
@@ -1096,8 +1096,12 @@
     stream = util.chunkbuffer(bundler.getchunks())
     try:
         try:
-            reply = pushop.remote.unbundle(
-                stream, ['force'], pushop.remote.url())
+            with pushop.remote.commandexecutor() as e:
+                reply = e.callcommand('unbundle', {
+                    'bundle': stream,
+                    'heads': ['force'],
+                    'url': pushop.remote.url(),
+                }).result()
         except error.BundleValueError as exc:
             raise error.Abort(_('missing support for %s') % exc)
         try: