comparison tests/test-blackbox.t @ 38023:c3fd9a0f8277

dispatch: mask negative exit code recorded in blackbox log That's what we do for the exit code delivered to the environment.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 16 May 2018 20:22:23 +0900
parents 48853a927757
children 5abc47d4ca6b
comparison
equal deleted inserted replaced
38022:48853a927757 38023:c3fd9a0f8277
5 > cmdtable = {} 5 > cmdtable = {}
6 > command = registrar.command(cmdtable) 6 > command = registrar.command(cmdtable)
7 > @command(b'crash', [], b'hg crash') 7 > @command(b'crash', [], b'hg crash')
8 > def crash(ui, *args, **kwargs): 8 > def crash(ui, *args, **kwargs):
9 > raise Exception("oops") 9 > raise Exception("oops")
10 > @command(b'abort', [], b'hg abort')
11 > def abort(ui, *args, **kwargs):
12 > raise error.Abort(b"oops")
10 > EOF 13 > EOF
11 $ abspath=`pwd`/myextension.py 14 $ abspath=`pwd`/myextension.py
12 15
13 $ cat >> $HGRCPATH <<EOF 16 $ cat >> $HGRCPATH <<EOF
14 > [extensions] 17 > [extensions]
41 [1] 44 [1]
42 $ hg blackbox 45 $ hg blackbox
43 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent 46 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent
44 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent exited 1 after * seconds (glob) 47 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent exited 1 after * seconds (glob)
45 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox 48 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
49
50 abort exit code
51 $ rm ./.hg/blackbox.log
52 $ hg abort 2> /dev/null
53 [255]
54 $ hg blackbox -l 2
55 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> abort exited 255 after * seconds (glob)
56 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox -l 2
46 57
47 unhandled exception 58 unhandled exception
48 $ rm ./.hg/blackbox.log 59 $ rm ./.hg/blackbox.log
49 $ hg crash 2> /dev/null 60 $ hg crash 2> /dev/null
50 [1] 61 [1]