comparison tests/blackbox-readonly-dispatch.py @ 43076:2372284d9457

formatting: blacken the codebase This is using my patch to black (https://github.com/psf/black/pull/826) so we don't un-wrap collection literals. Done with: hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions Differential Revision: https://phab.mercurial-scm.org/D6971
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:45:02 -0400
parents c93d046d4300
children 86e4daa2d54c
comparison
equal deleted inserted replaced
43075:57875cf423c9 43076:2372284d9457
3 from mercurial import ( 3 from mercurial import (
4 dispatch, 4 dispatch,
5 extensions, 5 extensions,
6 ui as uimod, 6 ui as uimod,
7 ) 7 )
8
8 9
9 def testdispatch(cmd): 10 def testdispatch(cmd):
10 """Simple wrapper around dispatch.dispatch() 11 """Simple wrapper around dispatch.dispatch()
11 12
12 Prints command and result value, but does not handle quoting. 13 Prints command and result value, but does not handle quoting.
15 extensions.populateui(ui) 16 extensions.populateui(ui)
16 ui.status(b"running: %s\n" % cmd) 17 ui.status(b"running: %s\n" % cmd)
17 req = dispatch.request(cmd.split(), ui) 18 req = dispatch.request(cmd.split(), ui)
18 result = dispatch.dispatch(req) 19 result = dispatch.dispatch(req)
19 ui.status(b"result: %r\n" % result) 20 ui.status(b"result: %r\n" % result)
21
20 22
21 # create file 'foo', add and commit 23 # create file 'foo', add and commit
22 f = open(b'foo', 'wb') 24 f = open(b'foo', 'wb')
23 f.write(b'foo\n') 25 f.write(b'foo\n')
24 f.close() 26 f.close()