diff mercurial/debugcommands.py @ 37652:fe8c6f9f2914

debugcommands: use command executor for invoking commands Now that all peers support the command executor interface, we can use it in place of peer._call() (which isn't part of the public API). Tests changed because we are now returning the decoded response instead of the raw bytes. The raw bytes over the wire are already logged. So we're not losing any test coverage. In fact, we're adding test coverage because we're testing decoding of those command responses as well. Differential Revision: https://phab.mercurial-scm.org/D3298
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 13 Apr 2018 12:31:34 -0700
parents 516b5a5edae3
children ad1c07008e0b
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Fri Apr 13 12:30:04 2018 -0700
+++ b/mercurial/debugcommands.py	Fri Apr 13 12:31:34 2018 -0700
@@ -3001,7 +3001,9 @@
                     ui.status(_('remote output: %s\n') %
                               stringutil.escapestr(output))
             else:
-                res = peer._call(command, **pycompat.strkwargs(args))
+                with peer.commandexecutor() as e:
+                    res = e.callcommand(command, args).result()
+
                 ui.status(_('response: %s\n') % stringutil.pprint(res))
 
         elif action == 'batchbegin':