Mercurial > hg
changeset 36738:70a98c3fba2a
py3: make blackbox-readonly-dispatch.py use ui instead of print()
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 04 Mar 2018 16:50:35 -0500 |
parents | 2a5024109490 |
children | f4a508f4ea87 |
files | tests/blackbox-readonly-dispatch.py |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/blackbox-readonly-dispatch.py Sun Mar 04 16:48:17 2018 -0500 +++ b/tests/blackbox-readonly-dispatch.py Sun Mar 04 16:50:35 2018 -0500 @@ -1,7 +1,8 @@ -from __future__ import absolute_import, print_function +from __future__ import absolute_import import os from mercurial import ( dispatch, + ui as uimod, ) def testdispatch(cmd): @@ -9,10 +10,11 @@ Prints command and result value, but does not handle quoting. """ - print("running: %s" % (cmd,)) - req = dispatch.request(cmd.split()) + ui = uimod.ui.load() + ui.status("running: %s\n" % cmd) + req = dispatch.request(cmd.split(), ui) result = dispatch.dispatch(req) - print("result: %r" % (result,)) + ui.status("result: %r\n" % result) # create file 'foo', add and commit f = open('foo', 'wb')