Patchwork [9,of,9] test-commandserver: make runcommand message bolder

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 28, 2014, 2:17 p.m.
Message ID <7ad208401b7056714b29.1411913844@mimosa>
Download mbox | patch
Permalink /patch/6004/
State Accepted
Commit cc3d9f776632933a012c567f6b17551f3dd4d5e0
Headers show

Comments

Yuya Nishihara - Sept. 28, 2014, 2:17 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1411892498 -32400
#      Sun Sep 28 17:21:38 2014 +0900
# Node ID 7ad208401b7056714b29376598a02c0845fd86c9
# Parent  78f284b3c5f8010feada79b9adfbe0a03ef96d10
test-commandserver: make runcommand message bolder

It seems ' runcommand' is difficult to distinguish from command output.
'*** runcommand' is slightly better.
Augie Fackler - Sept. 29, 2014, 6:46 p.m.
On Sun, Sep 28, 2014 at 11:17:24PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1411892498 -32400
> #      Sun Sep 28 17:21:38 2014 +0900
> # Node ID 7ad208401b7056714b29376598a02c0845fd86c9
> # Parent  78f284b3c5f8010feada79b9adfbe0a03ef96d10
> test-commandserver: make runcommand message bolder

Looks like a nice improvement overall, queued, thanks.

>
> It seems ' runcommand' is difficult to distinguish from command output.
> '*** runcommand' is slightly better.
>
> diff --git a/contrib/hgclient.py b/contrib/hgclient.py
> --- a/contrib/hgclient.py
> +++ b/contrib/hgclient.py
> @@ -32,7 +32,7 @@ def sep(text):
>
>  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))
> diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
> --- a/tests/test-commandserver.t
> +++ b/tests/test-commandserver.t
> @@ -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 @@ check that --cwd doesn't persist between
>    ...     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 @@ check that local configs for the cached
>    ...     # 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 @@ check that local configs for the cached
>    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 @@ check that local configs for the cached
>    ...                         '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 @@ check that local configs for the cached
>    ...     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 @@ check that local configs for the cached
>    ...     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 @@ check that local configs for the cached
>    ...     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 @@ check that local configs for the cached
>    ...     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 @@ check that local configs for the cached
>    ...     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 @@ check that local configs for the cached
>    ...     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 @@ check that local configs for the cached
>    ...     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 @@ check that local configs for the cached
>    ...
>    ...     # 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 @@ check that local configs for the cached
>    |/
>    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 @@ check that local configs for the cached
>    ...     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 @@ check that local configs for the cached
>    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 @@ check that local configs for the cached
>    ...     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 @@ check that local configs for the cached
>    ...     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 @@ start without repository:
>    ...     # 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 @@ start without repository:
>    ...     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
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/contrib/hgclient.py b/contrib/hgclient.py
--- a/contrib/hgclient.py
+++ b/contrib/hgclient.py
@@ -32,7 +32,7 @@  def sep(text):
 
 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))
diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
--- a/tests/test-commandserver.t
+++ b/tests/test-commandserver.t
@@ -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 @@  check that --cwd doesn't persist between
   ...     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 @@  check that local configs for the cached 
   ...     # 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 @@  check that local configs for the cached 
   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 @@  check that local configs for the cached 
   ...                         '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 @@  check that local configs for the cached 
   ...     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 @@  check that local configs for the cached 
   ...     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 @@  check that local configs for the cached 
   ...     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 @@  check that local configs for the cached 
   ...     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 @@  check that local configs for the cached 
   ...     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 @@  check that local configs for the cached 
   ...     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 @@  check that local configs for the cached 
   ...     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 @@  check that local configs for the cached 
   ... 
   ...     # 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 @@  check that local configs for the cached 
   |/
   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 @@  check that local configs for the cached 
   ...     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 @@  check that local configs for the cached 
   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 @@  check that local configs for the cached 
   ...     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 @@  check that local configs for the cached 
   ...     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 @@  start without repository:
   ...     # 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 @@  start without repository:
   ...     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