tests/test-blackbox.t
author Yuya Nishihara <yuya@tcha.org>
Wed, 16 May 2018 20:17:50 +0900
changeset 38022 48853a927757
parent 38016 81ca0fd348e3
child 38023 c3fd9a0f8277
permissions -rw-r--r--
dispatch: fix exit code of unhandled exception recorded in blackbox log Spotted by Martin von Zweigbergk. We might want to change the exit code to -1 (i.e. 255) because 1 means non-abort error in hg, but that's another issue.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18674
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
     1
setup
38016
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
     2
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
     3
  $ cat > myextension.py <<EOF
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
     4
  > from mercurial import error, registrar
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
     5
  > cmdtable = {}
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
     6
  > command = registrar.command(cmdtable)
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
     7
  > @command(b'crash', [], b'hg crash')
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
     8
  > def crash(ui, *args, **kwargs):
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
     9
  >     raise Exception("oops")
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    10
  > EOF
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    11
  $ abspath=`pwd`/myextension.py
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    12
18674
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    13
  $ cat >> $HGRCPATH <<EOF
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    14
  > [extensions]
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    15
  > blackbox=
24705
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21031
diff changeset
    16
  > mock=$TESTDIR/mockblackbox.py
18766
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
    17
  > mq=
38016
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    18
  > myextension=$TESTTMP/myextension.py
29846
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    19
  > [alias]
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    20
  > confuse = log --limit 3
34298
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    21
  > so-confusing = confuse --style compact
18674
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    22
  > EOF
38016
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    23
18674
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    24
  $ hg init blackboxtest
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    25
  $ cd blackboxtest
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    26
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    27
command, exit codes, and duration
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    28
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    29
  $ echo a > a
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    30
  $ hg add a
28246
b862e793ec10 blackbox: log dirty state
timeless <timeless@mozdev.org>
parents: 28245
diff changeset
    31
  $ hg blackbox --config blackbox.dirty=True
34276
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
    32
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob)
28245
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
    33
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a
28247
d2c0527af364 blackbox: store the blackbox ui object instead of the log file
timeless <timeless@mozdev.org>
parents: 28246
diff changeset
    34
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 34661
diff changeset
    35
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* (glob)
18674
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
    36
38016
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    37
failure exit code
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    38
  $ rm ./.hg/blackbox.log
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    39
  $ hg add non-existent
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    40
  non-existent: $ENOENT$
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    41
  [1]
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    42
  $ hg blackbox
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    43
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    44
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent exited 1 after * seconds (glob)
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    45
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    46
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    47
unhandled exception
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    48
  $ rm ./.hg/blackbox.log
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    49
  $ hg crash 2> /dev/null
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    50
  [1]
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    51
  $ hg blackbox -l 2
38022
48853a927757 dispatch: fix exit code of unhandled exception recorded in blackbox log
Yuya Nishihara <yuya@tcha.org>
parents: 38016
diff changeset
    52
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> crash exited 1 after * seconds (glob)
38016
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    53
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox -l 2
81ca0fd348e3 tests: test failure reporting in blackbox code
Martin von Zweigbergk <martinvonz@google.com>
parents: 37995
diff changeset
    54
29846
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    55
alias expansion is logged
34297
7f02fb920121 tests: clean up blackbox test around aliases a little bit
Augie Fackler <augie@google.com>
parents: 34276
diff changeset
    56
  $ rm ./.hg/blackbox.log
29846
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    57
  $ hg confuse
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    58
  $ hg blackbox
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    59
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    60
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    61
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob)
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    62
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
318e2b600b80 blackbox: also log alias expansions
Augie Fackler <augie@google.com>
parents: 28888
diff changeset
    63
34298
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    64
recursive aliases work correctly
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    65
  $ rm ./.hg/blackbox.log
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    66
  $ hg so-confusing
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    67
  $ hg blackbox
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    68
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    69
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'so-confusing' expands to 'confuse --style compact'
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    70
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    71
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing exited 0 after * seconds (glob)
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    72
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
25e1a8876cc0 tests: add a test for blackbox with nested alias configurations
Augie Fackler <augie@google.com>
parents: 34297
diff changeset
    73
18677
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    74
incoming change tracking
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    75
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    76
create two heads to verify that we only see one change in the log later
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    77
  $ hg commit -ma
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    78
  $ hg up null
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    79
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    80
  $ echo b > b
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    81
  $ hg commit -Amb
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    82
  adding b
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    83
  created new head
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    84
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    85
clone, commit, pull
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    86
  $ hg clone . ../blackboxtest2
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    87
  updating to branch default
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    88
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    89
  $ echo c > c
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    90
  $ hg commit -Amc
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    91
  adding c
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    92
  $ cd ../blackboxtest2
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    93
  $ hg pull
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35034
diff changeset
    94
  pulling from $TESTTMP/blackboxtest
18677
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    95
  searching for changes
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    96
  adding changesets
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    97
  adding manifests
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    98
  adding file changes
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
    99
  added 1 changesets with 1 changes to 1 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 34299
diff changeset
   100
  new changesets d02f48003e62
18677
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
   101
  (run 'hg update' to get a working copy)
28025
ab6468270b83 blackbox: flush output file descriptor
timeless <timeless@mozdev.org>
parents: 28024
diff changeset
   102
  $ hg blackbox -l 6
28245
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   103
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   104
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated served branch cache in * seconds (glob)
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   105
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote served branch cache with 1 labels and 2 nodes
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   106
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62
28247
d2c0527af364 blackbox: store the blackbox ui object instead of the log file
timeless <timeless@mozdev.org>
parents: 28246
diff changeset
   107
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob)
28245
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   108
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
18677
539210ed2069 blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents: 18674
diff changeset
   109
18786
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   110
we must not cause a failure if we cannot write to the log
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   111
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   112
  $ hg rollback
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   113
  repository tip rolled back to revision 1 (undo pull)
19082
63dda3c3bb11 blackbox: don't run permission tests on non-unix systems
Durham Goode <durham@fb.com>
parents: 19066
diff changeset
   114
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   115
  $ mv .hg/blackbox.log .hg/blackbox.log-
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   116
  $ mkdir .hg/blackbox.log
18786
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   117
  $ hg --debug incoming
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   118
  warning: cannot write to blackbox.log: * (glob)
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35034
diff changeset
   119
  comparing with $TESTTMP/blackboxtest
18786
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   120
  query 1; heads
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   121
  searching for changes
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   122
  all local heads known remotely
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   123
  changeset:   2:d02f48003e62c24e2659d97d30f2a83abe5d5d51
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   124
  tag:         tip
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   125
  phase:       draft
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   126
  parent:      1:6563da9dcf87b1949716e38ff3e3dfaa3198eb06
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   127
  parent:      -1:0000000000000000000000000000000000000000
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   128
  manifest:    2:ab9d46b053ebf45b7996f2922b9893ff4b63d892
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   129
  user:        test
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   130
  date:        Thu Jan 01 00:00:00 1970 +0000
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   131
  files+:      c
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   132
  extra:       branch=default
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   133
  description:
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   134
  c
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   135
  
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   136
  
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   137
  $ hg pull
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35034
diff changeset
   138
  pulling from $TESTTMP/blackboxtest
18786
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   139
  searching for changes
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   140
  adding changesets
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   141
  adding manifests
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   142
  adding file changes
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   143
  added 1 changesets with 1 changes to 1 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 34299
diff changeset
   144
  new changesets d02f48003e62
18786
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   145
  (run 'hg update' to get a working copy)
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   146
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   147
a failure reading from the log is fatal
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   148
18786
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   149
  $ hg blackbox -l 3
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   150
  abort: *$TESTTMP/blackboxtest2/.hg/blackbox.log* (glob)
18786
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   151
  [255]
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   152
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   153
  $ rmdir .hg/blackbox.log
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   154
  $ mv .hg/blackbox.log- .hg/blackbox.log
18786
ed39a8f94e95 blackbox: prevent failed I/O from causing hg to abort
Bryan O'Sullivan <bryano@fb.com>
parents: 18766
diff changeset
   155
18766
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   156
backup bundles get logged
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   157
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   158
  $ touch d
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   159
  $ hg commit -Amd
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   160
  adding d
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   161
  created new head
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   162
  $ hg strip tip
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   163
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   164
  saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob)
28025
ab6468270b83 blackbox: flush output file descriptor
timeless <timeless@mozdev.org>
parents: 28024
diff changeset
   165
  $ hg blackbox -l 6
28245
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   166
  1970/01/01 00:00:00 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35034
diff changeset
   167
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg
28245
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   168
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated base branch cache in * seconds (glob)
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   169
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote base branch cache with 1 labels and 2 nodes
28247
d2c0527af364 blackbox: store the blackbox ui object instead of the log file
timeless <timeless@mozdev.org>
parents: 28246
diff changeset
   170
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob)
28245
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   171
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
18766
64b5562550e2 blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents: 18720
diff changeset
   172
18674
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   173
extension and python hooks - use the eol extension for a pythonhook
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   174
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   175
  $ echo '[extensions]' >> .hg/hgrc
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   176
  $ echo 'eol=' >> .hg/hgrc
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   177
  $ echo '[hooks]' >> .hg/hgrc
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   178
  $ echo 'update = echo hooked' >> .hg/hgrc
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   179
  $ hg update
33425
886207fb18ab tests: take extra care for fsmonitor at enabling incompatible extension
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   180
  The fsmonitor extension is incompatible with the eol extension and has been disabled. (fsmonitor !)
26752
949e8c626d19 merge: make in-memory changes visible to external update hooks
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26185
diff changeset
   181
  hooked
26028
6fbe35588433 update: wlock the repo for the whole 'hg update' command
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24763
diff changeset
   182
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
32698
1b5c61d38a52 update: show the commit to which we updated in case of multiple heads (BC)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32266
diff changeset
   183
  updated to "d02f48003e62: c"
28029
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28028
diff changeset
   184
  1 other heads for branch "default"
33425
886207fb18ab tests: take extra care for fsmonitor at enabling incompatible extension
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   185
  $ cat >> .hg/hgrc <<EOF
886207fb18ab tests: take extra care for fsmonitor at enabling incompatible extension
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   186
  > [extensions]
886207fb18ab tests: take extra care for fsmonitor at enabling incompatible extension
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   187
  > # disable eol, because it is not needed for subsequent tests
886207fb18ab tests: take extra care for fsmonitor at enabling incompatible extension
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   188
  > # (in addition, keeping it requires extra care for fsmonitor)
886207fb18ab tests: take extra care for fsmonitor at enabling incompatible extension
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   189
  > eol=!
886207fb18ab tests: take extra care for fsmonitor at enabling incompatible extension
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   190
  > EOF
37507
9b16a67cef56 eol: look up partial nodeid as partial nodeid
Martin von Zweigbergk <martinvonz@google.com>
parents: 36740
diff changeset
   191
  $ hg blackbox -l 5
34106
06eb3de47649 test-blackbox: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 33425
diff changeset
   192
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update (no-chg !)
28245
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   193
  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   194
  1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob)
28247
d2c0527af364 blackbox: store the blackbox ui object instead of the log file
timeless <timeless@mozdev.org>
parents: 28246
diff changeset
   195
  1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob)
34106
06eb3de47649 test-blackbox: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 33425
diff changeset
   196
  1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> serve --cmdserver chgunix --address $TESTTMP.chgsock/server.* --daemon-postexec 'chdir:/' (glob) (chg !)
37507
9b16a67cef56 eol: look up partial nodeid as partial nodeid
Martin von Zweigbergk <martinvonz@google.com>
parents: 36740
diff changeset
   197
  1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 5
18674
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   198
19066
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   199
log rotation
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   200
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   201
  $ echo '[blackbox]' >> .hg/hgrc
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   202
  $ echo 'maxsize = 20 b' >> .hg/hgrc
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   203
  $ echo 'maxfiles = 3' >> .hg/hgrc
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   204
  $ hg status
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   205
  $ hg status
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   206
  $ hg status
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   207
  $ hg tip -q
24706
5150b2b5b345 tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24705
diff changeset
   208
  2:d02f48003e62
19066
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   209
  $ ls .hg/blackbox.log*
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   210
  .hg/blackbox.log
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   211
  .hg/blackbox.log.1
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   212
  .hg/blackbox.log.2
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   213
  $ cd ..
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   214
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   215
  $ hg init blackboxtest3
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   216
  $ cd blackboxtest3
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   217
  $ hg blackbox
34276
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   218
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest3 exited 0 after * seconds (glob)
28245
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   219
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   220
  $ mv .hg/blackbox.log .hg/blackbox.log-
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   221
  $ mkdir .hg/blackbox.log
28336
a5a13eeffc59 tests: Solaris sed does not support "\n" meaning newline in the RHS of s///
Danek Duvall <danek.duvall@oracle.com>
parents: 28248
diff changeset
   222
  $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\
a5a13eeffc59 tests: Solaris sed does not support "\n" meaning newline in the RHS of s///
Danek Duvall <danek.duvall@oracle.com>
parents: 28248
diff changeset
   223
  > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\
a5a13eeffc59 tests: Solaris sed does not support "\n" meaning newline in the RHS of s///
Danek Duvall <danek.duvall@oracle.com>
parents: 28248
diff changeset
   224
  > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py
32940
75be14993fda cleanup: use $PYTHON to run python in many more tests
Augie Fackler <augie@google.com>
parents: 32698
diff changeset
   225
  $ $PYTHON $TESTDIR/blackbox-readonly-dispatch.py
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   226
  running: --debug add foo
35729
7415cc923613 test-blackbox: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35724
diff changeset
   227
  warning: cannot write to blackbox.log: Is a directory (no-windows !)
7415cc923613 test-blackbox: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35724
diff changeset
   228
  warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !)
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   229
  adding foo
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   230
  result: 0
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   231
  running: --debug commit -m commit1 -d 2000-01-01 foo
35729
7415cc923613 test-blackbox: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35724
diff changeset
   232
  warning: cannot write to blackbox.log: Is a directory (no-windows !)
7415cc923613 test-blackbox: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35724
diff changeset
   233
  warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !)
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   234
  committing files:
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   235
  foo
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   236
  committing manifest
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   237
  committing changelog
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   238
  updating the branch cache
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   239
  committed changeset 0:0e46349438790c460c5c9f7546bfcd39b267bbd2
37995
6f9ac3cb0987 dispatch: unify handling of None returned by a command function
Yuya Nishihara <yuya@tcha.org>
parents: 37507
diff changeset
   240
  result: 0
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   241
  running: --debug commit -m commit2 -d 2000-01-02 foo
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   242
  committing files:
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   243
  foo
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   244
  committing manifest
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   245
  committing changelog
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   246
  updating the branch cache
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   247
  committed changeset 1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7
37995
6f9ac3cb0987 dispatch: unify handling of None returned by a command function
Yuya Nishihara <yuya@tcha.org>
parents: 37507
diff changeset
   248
  result: 0
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   249
  running: --debug log -r 0
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   250
  changeset:   0:0e46349438790c460c5c9f7546bfcd39b267bbd2
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   251
  phase:       draft
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   252
  parent:      -1:0000000000000000000000000000000000000000
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   253
  parent:      -1:0000000000000000000000000000000000000000
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   254
  manifest:    0:9091aa5df980aea60860a2e39c95182e68d1ddec
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   255
  user:        test
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   256
  date:        Sat Jan 01 00:00:00 2000 +0000
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   257
  files+:      foo
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   258
  extra:       branch=default
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   259
  description:
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   260
  commit1
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   261
  
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   262
  
37995
6f9ac3cb0987 dispatch: unify handling of None returned by a command function
Yuya Nishihara <yuya@tcha.org>
parents: 37507
diff changeset
   263
  result: 0
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   264
  running: --debug log -r tip
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   265
  changeset:   1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   266
  tag:         tip
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   267
  phase:       draft
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   268
  parent:      0:0e46349438790c460c5c9f7546bfcd39b267bbd2
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   269
  parent:      -1:0000000000000000000000000000000000000000
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   270
  manifest:    1:895aa9b7886f89dd017a6d62524e1f9180b04df9
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   271
  user:        test
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   272
  date:        Sun Jan 02 00:00:00 2000 +0000
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   273
  files:       foo
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   274
  extra:       branch=default
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   275
  description:
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   276
  commit2
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   277
  
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   278
  
37995
6f9ac3cb0987 dispatch: unify handling of None returned by a command function
Yuya Nishihara <yuya@tcha.org>
parents: 37507
diff changeset
   279
  result: 0
28024
142891ab6e89 tests: change blackbox test to work cross platform
timeless <timeless@mozdev.org>
parents: 26752
diff changeset
   280
  $ hg blackbox
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   281
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updating the branch cache
32266
2b6692df1bdf caches: stop warming the cache after 'localrepo.commitctx'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31773
diff changeset
   282
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated served branch cache in * seconds (glob)
2b6692df1bdf caches: stop warming the cache after 'localrepo.commitctx'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31773
diff changeset
   283
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote served branch cache with 1 labels and 1 nodes
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   284
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug commit -m commit2 -d 2000-01-02 foo exited 0 after *.?? seconds (glob)
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   285
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0
28248
851c41a21869 blackbox: properly replace ui class
timeless <timeless@mozdev.org>
parents: 28247
diff changeset
   286
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags
35724
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   287
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0 exited 0 after *.?? seconds (glob)
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   288
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip
853bf7d90804 blackbox: if --debug is used, also trace ui.debug() calls
Joerg Sonnenberger <joerg@bec.de>
parents: 35393
diff changeset
   289
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip exited 0 after *.?? seconds (glob)
28245
caa2a0c6fbb7 blackbox: log working directory version
timeless <timeless@mozdev.org>
parents: 28242
diff changeset
   290
  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox
19066
2cad301a7f06 blackbox: automatically rotate log files
Bryan O'Sullivan <bryano@fb.com>
parents: 18836
diff changeset
   291
28407
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   292
Test log recursion from dirty status check
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   293
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   294
  $ cat > ../r.py <<EOF
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   295
  > from mercurial import context, error, extensions
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   296
  > x=[False]
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   297
  > def status(orig, *args, **opts):
36740
2aff6daf7790 py3: byte-stringify test-blackbox.t
Yuya Nishihara <yuya@tcha.org>
parents: 35729
diff changeset
   298
  >     args[0].repo().ui.log(b"broken", b"recursion?")
28407
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   299
  >     return orig(*args, **opts)
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   300
  > def reposetup(ui, repo):
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   301
  >     extensions.wrapfunction(context.basectx, 'status', status)
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   302
  > EOF
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   303
  $ hg id --config extensions.x=../r.py --config blackbox.dirty=True
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   304
  45589e459b2e tip
63da8bd0c65e blackbox: guard against recursion from dirty check
timeless <timeless@mozdev.org>
parents: 28406
diff changeset
   305
18674
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   306
cleanup
c61b49d059eb blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff changeset
   307
  $ cd ..
34107
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   308
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   309
#if chg
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   310
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   311
when using chg, blackbox.log should get rotated correctly
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   312
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   313
  $ cat > $TESTTMP/noop.py << EOF
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   314
  > from __future__ import absolute_import
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   315
  > import time
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   316
  > from mercurial import registrar, scmutil
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   317
  > cmdtable = {}
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   318
  > command = registrar.command(cmdtable)
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   319
  > @command('noop')
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   320
  > def noop(ui, repo):
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   321
  >     pass
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   322
  > EOF
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   323
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   324
  $ hg init blackbox-chg
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   325
  $ cd blackbox-chg
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   326
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   327
  $ cat > .hg/hgrc << EOF
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   328
  > [blackbox]
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   329
  > maxsize = 500B
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   330
  > [extensions]
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   331
  > # extension change forces chg to restart
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   332
  > noop=$TESTTMP/noop.py
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   333
  > EOF
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   334
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   335
  $ $PYTHON -c 'print("a" * 400)' > .hg/blackbox.log
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   336
  $ chg noop
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   337
  $ chg noop
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   338
  $ chg noop
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   339
  $ chg noop
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   340
  $ chg noop
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   341
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   342
  $ cat > showsize.py << 'EOF'
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   343
  > import os, sys
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   344
  > limit = 500
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   345
  > for p in sys.argv[1:]:
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   346
  >     size = os.stat(p).st_size
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   347
  >     if size >= limit:
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   348
  >         desc = '>='
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   349
  >     else:
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   350
  >         desc = '<'
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   351
  >     print('%s: %s %d' % (p, desc, limit))
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   352
  > EOF
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   353
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   354
  $ $PYTHON showsize.py .hg/blackbox*
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   355
  .hg/blackbox.log: < 500
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   356
  .hg/blackbox.log.1: >= 500
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   357
  .hg/blackbox.log.2: >= 500
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   358
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   359
  $ cd ..
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   360
34299
b1d4ac068961 blackbox: do not prevent 'chg init' from working
Jun Wu <quark@fb.com>
parents: 34298
diff changeset
   361
With chg, blackbox should not create the log file if the repo is gone
b1d4ac068961 blackbox: do not prevent 'chg init' from working
Jun Wu <quark@fb.com>
parents: 34298
diff changeset
   362
b1d4ac068961 blackbox: do not prevent 'chg init' from working
Jun Wu <quark@fb.com>
parents: 34298
diff changeset
   363
  $ hg init repo1
b1d4ac068961 blackbox: do not prevent 'chg init' from working
Jun Wu <quark@fb.com>
parents: 34298
diff changeset
   364
  $ hg --config extensions.a=! -R repo1 log
b1d4ac068961 blackbox: do not prevent 'chg init' from working
Jun Wu <quark@fb.com>
parents: 34298
diff changeset
   365
  $ rm -rf $TESTTMP/repo1
b1d4ac068961 blackbox: do not prevent 'chg init' from working
Jun Wu <quark@fb.com>
parents: 34298
diff changeset
   366
  $ hg --config extensions.a=! init repo1
b1d4ac068961 blackbox: do not prevent 'chg init' from working
Jun Wu <quark@fb.com>
parents: 34298
diff changeset
   367
34107
4f60720cf0df blackbox: fix rotation with chg
Jun Wu <quark@fb.com>
parents: 34106
diff changeset
   368
#endif
34276
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   369
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   370
blackbox should work if repo.ui.log is not called (issue5518)
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   371
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   372
  $ cat > $TESTTMP/raise.py << EOF
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   373
  > from __future__ import absolute_import
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   374
  > from mercurial import registrar, scmutil
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   375
  > cmdtable = {}
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   376
  > command = registrar.command(cmdtable)
36740
2aff6daf7790 py3: byte-stringify test-blackbox.t
Yuya Nishihara <yuya@tcha.org>
parents: 35729
diff changeset
   377
  > @command(b'raise')
34276
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   378
  > def raisecmd(*args):
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   379
  >     raise RuntimeError('raise')
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   380
  > EOF
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   381
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   382
  $ cat >> $HGRCPATH << EOF
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   383
  > [blackbox]
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   384
  > track = commandexception
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   385
  > [extensions]
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   386
  > raise=$TESTTMP/raise.py
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   387
  > EOF
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   388
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   389
  $ hg init $TESTTMP/blackbox-exception-only
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   390
  $ cd $TESTTMP/blackbox-exception-only
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   391
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   392
#if chg
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   393
 (chg exits 255 because it fails to receive an exit code)
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   394
  $ hg raise 2>/dev/null
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   395
  [255]
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   396
#else
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   397
 (hg exits 1 because Python default exit code for uncaught exception is 1)
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   398
  $ hg raise 2>/dev/null
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   399
  [1]
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   400
#endif
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   401
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   402
  $ head -1 .hg/blackbox.log
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   403
  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> ** Unknown exception encountered with possibly-broken third-party extension mock
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   404
  $ tail -2 .hg/blackbox.log
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   405
  RuntimeError: raise
b90bd9a98c8b blackbox: set lastui even if ui.log is not called (issue5518)
Jun Wu <quark@fb.com>
parents: 34107
diff changeset
   406