tests/blackbox-readonly-dispatch.py
changeset 43076 2372284d9457
parent 40729 c93d046d4300
child 43080 86e4daa2d54c
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()