test-commandserver: make runcommand message bolder
authorYuya Nishihara <yuya@tcha.org>
Sun, 28 Sep 2014 17:21:38 +0900
changeset 22572 cc3d9f776632
parent 22571 a9ff1b350f62
child 22573 f528bfb25b45
test-commandserver: make runcommand message bolder It seems ' runcommand' is difficult to distinguish from command output. '*** runcommand' is slightly better.
contrib/hgclient.py
tests/test-commandserver.t
--- a/contrib/hgclient.py	Sun Sep 28 14:46:57 2014 +0900
+++ b/contrib/hgclient.py	Sun Sep 28 17:21:38 2014 +0900
@@ -32,7 +32,7 @@
 
 def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None,
                outfilter=lambda x: x):
-    print ' runcommand', ' '.join(args)
+    print '*** runcommand', ' '.join(args)
     sys.stdout.flush()
     server.stdin.write('runcommand\n')
     writeblock(server, '\0'.join(args))
--- a/tests/test-commandserver.t	Sun Sep 28 14:46:57 2014 +0900
+++ b/tests/test-commandserver.t	Sun Sep 28 17:21:38 2014 +0900
@@ -17,7 +17,7 @@
   ...     # sends isn't part of the hello message
   ...     runcommand(server, ['id'])
   o, 'capabilities: getencoding runcommand\nencoding: *' (glob)
-   runcommand id
+  *** runcommand id
   000000000000 tip
 
   >>> from hgclient import check
@@ -49,7 +49,7 @@
   ... 
   ...     # negative return code should be masked
   ...     runcommand(server, ['id', '-runknown'])
-   runcommand 
+  *** runcommand 
   Mercurial Distributed SCM
   
   basic commands:
@@ -73,15 +73,15 @@
    update        update working directory (or switch revisions)
   
   (use "hg help" for the full list of commands or "hg -v" for details)
-   runcommand id --quiet
+  *** runcommand id --quiet
   000000000000
-   runcommand id
+  *** runcommand id
   000000000000 tip
-   runcommand id --config ui.quiet=True
+  *** runcommand id --config ui.quiet=True
   000000000000
-   runcommand id
+  *** runcommand id
   000000000000 tip
-   runcommand id -runknown
+  *** runcommand id -runknown
   abort: unknown revision 'unknown'!
    [255]
 
@@ -120,9 +120,9 @@
   ... 
   ...     runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch))
   ...     runcommand(server, ['log'])
-   runcommand import -
+  *** runcommand import -
   applying patch from stdin
-   runcommand log
+  *** runcommand log
   changeset:   0:eff892de26ec
   tag:         tip
   user:        test
@@ -140,9 +140,9 @@
   ...     readchannel(server)
   ...     runcommand(server, ['--cwd', 'foo', 'st', 'bar'])
   ...     runcommand(server, ['st', 'foo/bar'])
-   runcommand --cwd foo st bar
+  *** runcommand --cwd foo st bar
   ? bar
-   runcommand st foo/bar
+  *** runcommand st foo/bar
   ? foo/bar
 
   $ rm foo/bar
@@ -167,7 +167,7 @@
   ...     # but not for this repo
   ...     runcommand(server, ['init', 'foo'])
   ...     runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults'])
-   runcommand showconfig
+  *** runcommand showconfig
   bundle.mainreporoot=$TESTTMP/repo
   defaults.backout=-d "0 0"
   defaults.commit=-d "0 0"
@@ -178,8 +178,8 @@
   ui.mergemarkers=detailed
   ui.foo=bar
   ui.nontty=true
-   runcommand init foo
-   runcommand -R foo showconfig ui defaults
+  *** runcommand init foo
+  *** runcommand -R foo showconfig ui defaults
   defaults.backout=-d "0 0"
   defaults.commit=-d "0 0"
   defaults.shelve=--date "0 0"
@@ -213,7 +213,7 @@
   ...                         'hooks.pre-identify=python:hook.hook',
   ...                         'id'],
   ...                input=cStringIO.StringIO('some input'))
-   runcommand --config hooks.pre-identify=python:hook.hook id
+  *** runcommand --config hooks.pre-identify=python:hook.hook id
   hook talking
   now try to read something: 'some input'
   eff892de26ec tip
@@ -230,16 +230,16 @@
   ...     os.system('hg ci -Am2')
   ...     runcommand(server, ['tip'])
   ...     runcommand(server, ['status'])
-   runcommand status
+  *** runcommand status
   M a
-   runcommand tip
+  *** runcommand tip
   changeset:   1:d3a0a68be6de
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     2
   
-   runcommand status
+  *** runcommand status
 
   >>> import os
   >>> from hgclient import readchannel, runcommand, check
@@ -263,17 +263,17 @@
   ...     f.close()
   ...     runcommand(server, ['commit', '-Amm'])
   ...     runcommand(server, ['bookmarks'])
-   runcommand bookmarks
+  *** runcommand bookmarks
   no bookmarks set
-   runcommand bookmarks
+  *** runcommand bookmarks
      bm1                       1:d3a0a68be6de
      bm2                       1:d3a0a68be6de
-   runcommand bookmarks
+  *** runcommand bookmarks
    * bm1                       1:d3a0a68be6de
      bm2                       1:d3a0a68be6de
-   runcommand bookmarks bm3
-   runcommand commit -Amm
-   runcommand bookmarks
+  *** runcommand bookmarks bm3
+  *** runcommand commit -Amm
+  *** runcommand bookmarks
      bm1                       1:d3a0a68be6de
      bm2                       1:d3a0a68be6de
    * bm3                       2:aef17e88f5f0
@@ -286,9 +286,9 @@
   ...     runcommand(server, ['id', '-t', '-r', '0'])
   ...     os.system('hg tag -r 0 foo')
   ...     runcommand(server, ['id', '-t', '-r', '0'])
-   runcommand id -t -r 0
+  *** runcommand id -t -r 0
   
-   runcommand id -t -r 0
+  *** runcommand id -t -r 0
   foo
 
   >>> import os
@@ -299,9 +299,9 @@
   ...     runcommand(server, ['phase', '-r', '.'])
   ...     os.system('hg phase -r . -p')
   ...     runcommand(server, ['phase', '-r', '.'])
-   runcommand phase -r .
+  *** runcommand phase -r .
   3: draft
-   runcommand phase -r .
+  *** runcommand phase -r .
   3: public
 
   $ echo a >> a
@@ -313,14 +313,14 @@
   ...     runcommand(server, ['commit', '-Am.'])
   ...     runcommand(server, ['rollback'])
   ...     runcommand(server, ['phase', '-r', '.'])
-   runcommand phase -r . -p
+  *** runcommand phase -r . -p
   no phases changed
    [1]
-   runcommand commit -Am.
-   runcommand rollback
+  *** runcommand commit -Am.
+  *** runcommand rollback
   repository tip rolled back to revision 3 (undo commit)
   working directory now based on revision 3
-   runcommand phase -r .
+  *** runcommand phase -r .
   3: public
 
   >>> import os
@@ -332,11 +332,11 @@
   ...     os.system('hg branch foo')
   ...     runcommand(server, ['branch'])
   ...     os.system('hg branch default')
-   runcommand branch
+  *** runcommand branch
   default
   marked working directory as branch foo
   (branches are permanent and global, did you want a bookmark?)
-   runcommand branch
+  *** runcommand branch
   foo
   marked working directory as branch default
   (branches are permanent and global, did you want a bookmark?)
@@ -355,9 +355,9 @@
   ...     f.write('ignored-file')
   ...     f.close()
   ...     runcommand(server, ['status', '-i', '-u'])
-   runcommand commit -Am.
+  *** runcommand commit -Am.
   adding .hgignore
-   runcommand status -i -u
+  *** runcommand status -i -u
   I ignored-file
 
   >>> import os
@@ -384,12 +384,12 @@
   ... 
   ...     # shouldn't raise "7966c8e3734d: no node!"
   ...     runcommand(server, ['branches'])
-   runcommand update -C 0
+  *** runcommand update -C 0
   1 files updated, 0 files merged, 2 files removed, 0 files unresolved
   (leaving bookmark bm3)
-   runcommand commit -Am. a
+  *** runcommand commit -Am. a
   created new head
-   runcommand log -Gq
+  *** runcommand log -Gq
   @  5:731265503d86
   |
   | o  4:7966c8e3734d
@@ -402,10 +402,10 @@
   |/
   o  0:eff892de26ec
   
-   runcommand phase -p .
-   runcommand phase .
+  *** runcommand phase -p .
+  *** runcommand phase .
   5: public
-   runcommand branches
+  *** runcommand branches
   default                        1:731265503d86
 
   $ cat <<EOF > obs.py
@@ -431,10 +431,10 @@
   ...     os.system(cmd)
   ...     runcommand(server, ['log', '--hidden'])
   ...     runcommand(server, ['log'])
-   runcommand up null
+  *** runcommand up null
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-   runcommand phase -df tip
-   runcommand log --hidden
+  *** runcommand phase -df tip
+  *** runcommand log --hidden
   changeset:   1:731265503d86
   tag:         tip
   user:        test
@@ -449,7 +449,7 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     1
   
-   runcommand log
+  *** runcommand log
   changeset:   0:eff892de26ec
   bookmark:    bm1
   bookmark:    bm2
@@ -481,13 +481,13 @@
   ...     os.system('hg qqueue --create foo')
   ...     # repo.mq should be recreated to point to new queue
   ...     runcommand(server, ['qqueue', '--active'])
-   runcommand qapplied
-   runcommand qapplied
+  *** runcommand qapplied
+  *** runcommand qapplied
   0.diff
-   runcommand qpop --all
+  *** runcommand qpop --all
   popping 0.diff
   patch queue now empty
-   runcommand qqueue --active
+  *** runcommand qqueue --active
   foo
 
   $ cat <<EOF > dbgui.py
@@ -511,7 +511,7 @@
   ...     runcommand(server, ['debuggetpass', '--config',
   ...                         'ui.interactive=True'],
   ...                input=cStringIO.StringIO('1234\n'))
-   runcommand debuggetpass --config ui.interactive=True
+  *** runcommand debuggetpass --config ui.interactive=True
   password: 1234
 
 
@@ -528,7 +528,7 @@
   ...     # sends isn't part of the hello message
   ...     runcommand(server, ['id'])
   o, 'capabilities: getencoding runcommand\nencoding: *' (glob)
-   runcommand id
+  *** runcommand id
   abort: there is no Mercurial repository here (.hg not found)
    [255]
 
@@ -538,6 +538,6 @@
   ...     readchannel(server)
   ...     runcommand(server, ['init', 'repo2'])
   ...     runcommand(server, ['id', '-R', 'repo2'])
-   runcommand init repo2
-   runcommand id -R repo2
+  *** runcommand init repo2
+  *** runcommand id -R repo2
   000000000000 tip