tests/test-dispatch.py
changeset 28405 1d9d29d4813a
parent 28404 06245740b408
child 36374 f0c94af0d70d
equal deleted inserted replaced
28404:06245740b408 28405:1d9d29d4813a
     1 from __future__ import absolute_import
     1 from __future__ import absolute_import, print_function
     2 import os
     2 import os
     3 from mercurial import (
     3 from mercurial import (
     4     dispatch,
     4     dispatch,
     5 )
     5 )
     6 
     6 
     7 def testdispatch(cmd):
     7 def testdispatch(cmd):
     8     """Simple wrapper around dispatch.dispatch()
     8     """Simple wrapper around dispatch.dispatch()
     9 
     9 
    10     Prints command and result value, but does not handle quoting.
    10     Prints command and result value, but does not handle quoting.
    11     """
    11     """
    12     print "running: %s" % (cmd,)
    12     print("running: %s" % (cmd,))
    13     req = dispatch.request(cmd.split())
    13     req = dispatch.request(cmd.split())
    14     result = dispatch.dispatch(req)
    14     result = dispatch.dispatch(req)
    15     print "result: %r" % (result,)
    15     print("result: %r" % (result,))
    16 
       
    17 
    16 
    18 testdispatch("init test1")
    17 testdispatch("init test1")
    19 os.chdir('test1')
    18 os.chdir('test1')
    20 
    19 
    21 # create file 'foo', add and commit
    20 # create file 'foo', add and commit