Show More
@@ -1,375 +1,406 b'' | |||||
1 | setup |
|
1 | setup | |
|
2 | ||||
|
3 | $ cat > myextension.py <<EOF | |||
|
4 | > from mercurial import error, registrar | |||
|
5 | > cmdtable = {} | |||
|
6 | > command = registrar.command(cmdtable) | |||
|
7 | > @command(b'crash', [], b'hg crash') | |||
|
8 | > def crash(ui, *args, **kwargs): | |||
|
9 | > raise Exception("oops") | |||
|
10 | > EOF | |||
|
11 | $ abspath=`pwd`/myextension.py | |||
|
12 | ||||
2 |
$ |
|
13 | $ cat >> $HGRCPATH <<EOF | |
3 | > [extensions] |
|
14 | > [extensions] | |
4 | > blackbox= |
|
15 | > blackbox= | |
5 |
> mock=$ |
|
16 | > mock=$TESTDIR/mockblackbox.py | |
6 | > mq= |
|
17 | > mq= | |
|
18 | > myextension=$TESTTMP/myextension.py | |||
7 | > [alias] |
|
19 | > [alias] | |
8 | > confuse = log --limit 3 |
|
20 | > confuse = log --limit 3 | |
9 | > so-confusing = confuse --style compact |
|
21 | > so-confusing = confuse --style compact | |
10 | > EOF |
|
22 | > EOF | |
|
23 | ||||
11 | $ hg init blackboxtest |
|
24 | $ hg init blackboxtest | |
12 | $ cd blackboxtest |
|
25 | $ cd blackboxtest | |
13 |
|
26 | |||
14 | command, exit codes, and duration |
|
27 | command, exit codes, and duration | |
15 |
|
28 | |||
16 | $ echo a > a |
|
29 | $ echo a > a | |
17 | $ hg add a |
|
30 | $ hg add a | |
18 | $ hg blackbox --config blackbox.dirty=True |
|
31 | $ hg blackbox --config blackbox.dirty=True | |
19 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob) |
|
32 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob) | |
20 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a |
|
33 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a | |
21 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob) |
|
34 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob) | |
22 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* (glob) |
|
35 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* (glob) | |
23 |
|
36 | |||
|
37 | failure exit code | |||
|
38 | $ rm ./.hg/blackbox.log | |||
|
39 | $ hg add non-existent | |||
|
40 | non-existent: $ENOENT$ | |||
|
41 | [1] | |||
|
42 | $ hg blackbox | |||
|
43 | 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) | |||
|
45 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox | |||
|
46 | ||||
|
47 | unhandled exception | |||
|
48 | $ rm ./.hg/blackbox.log | |||
|
49 | $ hg crash 2> /dev/null | |||
|
50 | [1] | |||
|
51 | $ hg blackbox -l 2 | |||
|
52 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> crash exited -1 after * seconds (glob) | |||
|
53 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox -l 2 | |||
|
54 | ||||
24 | alias expansion is logged |
|
55 | alias expansion is logged | |
25 | $ rm ./.hg/blackbox.log |
|
56 | $ rm ./.hg/blackbox.log | |
26 | $ hg confuse |
|
57 | $ hg confuse | |
27 | $ hg blackbox |
|
58 | $ hg blackbox | |
28 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse |
|
59 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse | |
29 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3' |
|
60 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3' | |
30 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob) |
|
61 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob) | |
31 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox |
|
62 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox | |
32 |
|
63 | |||
33 | recursive aliases work correctly |
|
64 | recursive aliases work correctly | |
34 | $ rm ./.hg/blackbox.log |
|
65 | $ rm ./.hg/blackbox.log | |
35 | $ hg so-confusing |
|
66 | $ hg so-confusing | |
36 | $ hg blackbox |
|
67 | $ hg blackbox | |
37 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing |
|
68 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing | |
38 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'so-confusing' expands to 'confuse --style compact' |
|
69 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'so-confusing' expands to 'confuse --style compact' | |
39 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3' |
|
70 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3' | |
40 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing exited 0 after * seconds (glob) |
|
71 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing exited 0 after * seconds (glob) | |
41 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox |
|
72 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox | |
42 |
|
73 | |||
43 | incoming change tracking |
|
74 | incoming change tracking | |
44 |
|
75 | |||
45 | create two heads to verify that we only see one change in the log later |
|
76 | create two heads to verify that we only see one change in the log later | |
46 | $ hg commit -ma |
|
77 | $ hg commit -ma | |
47 | $ hg up null |
|
78 | $ hg up null | |
48 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
79 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
49 | $ echo b > b |
|
80 | $ echo b > b | |
50 | $ hg commit -Amb |
|
81 | $ hg commit -Amb | |
51 | adding b |
|
82 | adding b | |
52 | created new head |
|
83 | created new head | |
53 |
|
84 | |||
54 | clone, commit, pull |
|
85 | clone, commit, pull | |
55 | $ hg clone . ../blackboxtest2 |
|
86 | $ hg clone . ../blackboxtest2 | |
56 | updating to branch default |
|
87 | updating to branch default | |
57 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
88 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
58 | $ echo c > c |
|
89 | $ echo c > c | |
59 | $ hg commit -Amc |
|
90 | $ hg commit -Amc | |
60 | adding c |
|
91 | adding c | |
61 | $ cd ../blackboxtest2 |
|
92 | $ cd ../blackboxtest2 | |
62 | $ hg pull |
|
93 | $ hg pull | |
63 | pulling from $TESTTMP/blackboxtest |
|
94 | pulling from $TESTTMP/blackboxtest | |
64 | searching for changes |
|
95 | searching for changes | |
65 | adding changesets |
|
96 | adding changesets | |
66 | adding manifests |
|
97 | adding manifests | |
67 | adding file changes |
|
98 | adding file changes | |
68 | added 1 changesets with 1 changes to 1 files |
|
99 | added 1 changesets with 1 changes to 1 files | |
69 | new changesets d02f48003e62 |
|
100 | new changesets d02f48003e62 | |
70 | (run 'hg update' to get a working copy) |
|
101 | (run 'hg update' to get a working copy) | |
71 | $ hg blackbox -l 6 |
|
102 | $ hg blackbox -l 6 | |
72 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull |
|
103 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull | |
73 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated served branch cache in * seconds (glob) |
|
104 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated served branch cache in * seconds (glob) | |
74 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote served branch cache with 1 labels and 2 nodes |
|
105 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote served branch cache with 1 labels and 2 nodes | |
75 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62 |
|
106 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62 | |
76 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob) |
|
107 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob) | |
77 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6 |
|
108 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6 | |
78 |
|
109 | |||
79 | we must not cause a failure if we cannot write to the log |
|
110 | we must not cause a failure if we cannot write to the log | |
80 |
|
111 | |||
81 | $ hg rollback |
|
112 | $ hg rollback | |
82 | repository tip rolled back to revision 1 (undo pull) |
|
113 | repository tip rolled back to revision 1 (undo pull) | |
83 |
|
114 | |||
84 | $ mv .hg/blackbox.log .hg/blackbox.log- |
|
115 | $ mv .hg/blackbox.log .hg/blackbox.log- | |
85 | $ mkdir .hg/blackbox.log |
|
116 | $ mkdir .hg/blackbox.log | |
86 | $ hg --debug incoming |
|
117 | $ hg --debug incoming | |
87 | warning: cannot write to blackbox.log: * (glob) |
|
118 | warning: cannot write to blackbox.log: * (glob) | |
88 | comparing with $TESTTMP/blackboxtest |
|
119 | comparing with $TESTTMP/blackboxtest | |
89 | query 1; heads |
|
120 | query 1; heads | |
90 | searching for changes |
|
121 | searching for changes | |
91 | all local heads known remotely |
|
122 | all local heads known remotely | |
92 | changeset: 2:d02f48003e62c24e2659d97d30f2a83abe5d5d51 |
|
123 | changeset: 2:d02f48003e62c24e2659d97d30f2a83abe5d5d51 | |
93 | tag: tip |
|
124 | tag: tip | |
94 | phase: draft |
|
125 | phase: draft | |
95 | parent: 1:6563da9dcf87b1949716e38ff3e3dfaa3198eb06 |
|
126 | parent: 1:6563da9dcf87b1949716e38ff3e3dfaa3198eb06 | |
96 | parent: -1:0000000000000000000000000000000000000000 |
|
127 | parent: -1:0000000000000000000000000000000000000000 | |
97 | manifest: 2:ab9d46b053ebf45b7996f2922b9893ff4b63d892 |
|
128 | manifest: 2:ab9d46b053ebf45b7996f2922b9893ff4b63d892 | |
98 | user: test |
|
129 | user: test | |
99 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
130 | date: Thu Jan 01 00:00:00 1970 +0000 | |
100 | files+: c |
|
131 | files+: c | |
101 | extra: branch=default |
|
132 | extra: branch=default | |
102 | description: |
|
133 | description: | |
103 | c |
|
134 | c | |
104 |
|
135 | |||
105 |
|
136 | |||
106 | $ hg pull |
|
137 | $ hg pull | |
107 | pulling from $TESTTMP/blackboxtest |
|
138 | pulling from $TESTTMP/blackboxtest | |
108 | searching for changes |
|
139 | searching for changes | |
109 | adding changesets |
|
140 | adding changesets | |
110 | adding manifests |
|
141 | adding manifests | |
111 | adding file changes |
|
142 | adding file changes | |
112 | added 1 changesets with 1 changes to 1 files |
|
143 | added 1 changesets with 1 changes to 1 files | |
113 | new changesets d02f48003e62 |
|
144 | new changesets d02f48003e62 | |
114 | (run 'hg update' to get a working copy) |
|
145 | (run 'hg update' to get a working copy) | |
115 |
|
146 | |||
116 | a failure reading from the log is fatal |
|
147 | a failure reading from the log is fatal | |
117 |
|
148 | |||
118 | $ hg blackbox -l 3 |
|
149 | $ hg blackbox -l 3 | |
119 | abort: *$TESTTMP/blackboxtest2/.hg/blackbox.log* (glob) |
|
150 | abort: *$TESTTMP/blackboxtest2/.hg/blackbox.log* (glob) | |
120 | [255] |
|
151 | [255] | |
121 |
|
152 | |||
122 | $ rmdir .hg/blackbox.log |
|
153 | $ rmdir .hg/blackbox.log | |
123 | $ mv .hg/blackbox.log- .hg/blackbox.log |
|
154 | $ mv .hg/blackbox.log- .hg/blackbox.log | |
124 |
|
155 | |||
125 | backup bundles get logged |
|
156 | backup bundles get logged | |
126 |
|
157 | |||
127 | $ touch d |
|
158 | $ touch d | |
128 | $ hg commit -Amd |
|
159 | $ hg commit -Amd | |
129 | adding d |
|
160 | adding d | |
130 | created new head |
|
161 | created new head | |
131 | $ hg strip tip |
|
162 | $ hg strip tip | |
132 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
163 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
133 | saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob) |
|
164 | saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob) | |
134 | $ hg blackbox -l 6 |
|
165 | $ hg blackbox -l 6 | |
135 | 1970/01/01 00:00:00 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip |
|
166 | 1970/01/01 00:00:00 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip | |
136 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg |
|
167 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg | |
137 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated base branch cache in * seconds (glob) |
|
168 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated base branch cache in * seconds (glob) | |
138 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote base branch cache with 1 labels and 2 nodes |
|
169 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote base branch cache with 1 labels and 2 nodes | |
139 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob) |
|
170 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob) | |
140 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6 |
|
171 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6 | |
141 |
|
172 | |||
142 | extension and python hooks - use the eol extension for a pythonhook |
|
173 | extension and python hooks - use the eol extension for a pythonhook | |
143 |
|
174 | |||
144 | $ echo '[extensions]' >> .hg/hgrc |
|
175 | $ echo '[extensions]' >> .hg/hgrc | |
145 | $ echo 'eol=' >> .hg/hgrc |
|
176 | $ echo 'eol=' >> .hg/hgrc | |
146 | $ echo '[hooks]' >> .hg/hgrc |
|
177 | $ echo '[hooks]' >> .hg/hgrc | |
147 | $ echo 'update = echo hooked' >> .hg/hgrc |
|
178 | $ echo 'update = echo hooked' >> .hg/hgrc | |
148 | $ hg update |
|
179 | $ hg update | |
149 | The fsmonitor extension is incompatible with the eol extension and has been disabled. (fsmonitor !) |
|
180 | The fsmonitor extension is incompatible with the eol extension and has been disabled. (fsmonitor !) | |
150 | hooked |
|
181 | hooked | |
151 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
182 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
152 | updated to "d02f48003e62: c" |
|
183 | updated to "d02f48003e62: c" | |
153 | 1 other heads for branch "default" |
|
184 | 1 other heads for branch "default" | |
154 | $ cat >> .hg/hgrc <<EOF |
|
185 | $ cat >> .hg/hgrc <<EOF | |
155 | > [extensions] |
|
186 | > [extensions] | |
156 | > # disable eol, because it is not needed for subsequent tests |
|
187 | > # disable eol, because it is not needed for subsequent tests | |
157 | > # (in addition, keeping it requires extra care for fsmonitor) |
|
188 | > # (in addition, keeping it requires extra care for fsmonitor) | |
158 | > eol=! |
|
189 | > eol=! | |
159 | > EOF |
|
190 | > EOF | |
160 | $ hg blackbox -l 5 |
|
191 | $ hg blackbox -l 5 | |
161 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update (no-chg !) |
|
192 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update (no-chg !) | |
162 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob) |
|
193 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob) | |
163 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob) |
|
194 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob) | |
164 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob) |
|
195 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob) | |
165 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> serve --cmdserver chgunix --address $TESTTMP.chgsock/server.* --daemon-postexec 'chdir:/' (glob) (chg !) |
|
196 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> serve --cmdserver chgunix --address $TESTTMP.chgsock/server.* --daemon-postexec 'chdir:/' (glob) (chg !) | |
166 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 5 |
|
197 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 5 | |
167 |
|
198 | |||
168 | log rotation |
|
199 | log rotation | |
169 |
|
200 | |||
170 | $ echo '[blackbox]' >> .hg/hgrc |
|
201 | $ echo '[blackbox]' >> .hg/hgrc | |
171 | $ echo 'maxsize = 20 b' >> .hg/hgrc |
|
202 | $ echo 'maxsize = 20 b' >> .hg/hgrc | |
172 | $ echo 'maxfiles = 3' >> .hg/hgrc |
|
203 | $ echo 'maxfiles = 3' >> .hg/hgrc | |
173 | $ hg status |
|
204 | $ hg status | |
174 | $ hg status |
|
205 | $ hg status | |
175 | $ hg status |
|
206 | $ hg status | |
176 | $ hg tip -q |
|
207 | $ hg tip -q | |
177 | 2:d02f48003e62 |
|
208 | 2:d02f48003e62 | |
178 | $ ls .hg/blackbox.log* |
|
209 | $ ls .hg/blackbox.log* | |
179 | .hg/blackbox.log |
|
210 | .hg/blackbox.log | |
180 | .hg/blackbox.log.1 |
|
211 | .hg/blackbox.log.1 | |
181 | .hg/blackbox.log.2 |
|
212 | .hg/blackbox.log.2 | |
182 | $ cd .. |
|
213 | $ cd .. | |
183 |
|
214 | |||
184 | $ hg init blackboxtest3 |
|
215 | $ hg init blackboxtest3 | |
185 | $ cd blackboxtest3 |
|
216 | $ cd blackboxtest3 | |
186 | $ hg blackbox |
|
217 | $ hg blackbox | |
187 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest3 exited 0 after * seconds (glob) |
|
218 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest3 exited 0 after * seconds (glob) | |
188 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox |
|
219 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox | |
189 | $ mv .hg/blackbox.log .hg/blackbox.log- |
|
220 | $ mv .hg/blackbox.log .hg/blackbox.log- | |
190 | $ mkdir .hg/blackbox.log |
|
221 | $ mkdir .hg/blackbox.log | |
191 | $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\ |
|
222 | $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\ | |
192 | > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\ |
|
223 | > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\ | |
193 | > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py |
|
224 | > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py | |
194 | $ $PYTHON $TESTDIR/blackbox-readonly-dispatch.py |
|
225 | $ $PYTHON $TESTDIR/blackbox-readonly-dispatch.py | |
195 | running: --debug add foo |
|
226 | running: --debug add foo | |
196 | warning: cannot write to blackbox.log: Is a directory (no-windows !) |
|
227 | warning: cannot write to blackbox.log: Is a directory (no-windows !) | |
197 | warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !) |
|
228 | warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !) | |
198 | adding foo |
|
229 | adding foo | |
199 | result: 0 |
|
230 | result: 0 | |
200 | running: --debug commit -m commit1 -d 2000-01-01 foo |
|
231 | running: --debug commit -m commit1 -d 2000-01-01 foo | |
201 | warning: cannot write to blackbox.log: Is a directory (no-windows !) |
|
232 | warning: cannot write to blackbox.log: Is a directory (no-windows !) | |
202 | warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !) |
|
233 | warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !) | |
203 | committing files: |
|
234 | committing files: | |
204 | foo |
|
235 | foo | |
205 | committing manifest |
|
236 | committing manifest | |
206 | committing changelog |
|
237 | committing changelog | |
207 | updating the branch cache |
|
238 | updating the branch cache | |
208 | committed changeset 0:0e46349438790c460c5c9f7546bfcd39b267bbd2 |
|
239 | committed changeset 0:0e46349438790c460c5c9f7546bfcd39b267bbd2 | |
209 | result: 0 |
|
240 | result: 0 | |
210 | running: --debug commit -m commit2 -d 2000-01-02 foo |
|
241 | running: --debug commit -m commit2 -d 2000-01-02 foo | |
211 | committing files: |
|
242 | committing files: | |
212 | foo |
|
243 | foo | |
213 | committing manifest |
|
244 | committing manifest | |
214 | committing changelog |
|
245 | committing changelog | |
215 | updating the branch cache |
|
246 | updating the branch cache | |
216 | committed changeset 1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7 |
|
247 | committed changeset 1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7 | |
217 | result: 0 |
|
248 | result: 0 | |
218 | running: --debug log -r 0 |
|
249 | running: --debug log -r 0 | |
219 | changeset: 0:0e46349438790c460c5c9f7546bfcd39b267bbd2 |
|
250 | changeset: 0:0e46349438790c460c5c9f7546bfcd39b267bbd2 | |
220 | phase: draft |
|
251 | phase: draft | |
221 | parent: -1:0000000000000000000000000000000000000000 |
|
252 | parent: -1:0000000000000000000000000000000000000000 | |
222 | parent: -1:0000000000000000000000000000000000000000 |
|
253 | parent: -1:0000000000000000000000000000000000000000 | |
223 | manifest: 0:9091aa5df980aea60860a2e39c95182e68d1ddec |
|
254 | manifest: 0:9091aa5df980aea60860a2e39c95182e68d1ddec | |
224 | user: test |
|
255 | user: test | |
225 | date: Sat Jan 01 00:00:00 2000 +0000 |
|
256 | date: Sat Jan 01 00:00:00 2000 +0000 | |
226 | files+: foo |
|
257 | files+: foo | |
227 | extra: branch=default |
|
258 | extra: branch=default | |
228 | description: |
|
259 | description: | |
229 | commit1 |
|
260 | commit1 | |
230 |
|
261 | |||
231 |
|
262 | |||
232 | result: 0 |
|
263 | result: 0 | |
233 | running: --debug log -r tip |
|
264 | running: --debug log -r tip | |
234 | changeset: 1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7 |
|
265 | changeset: 1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7 | |
235 | tag: tip |
|
266 | tag: tip | |
236 | phase: draft |
|
267 | phase: draft | |
237 | parent: 0:0e46349438790c460c5c9f7546bfcd39b267bbd2 |
|
268 | parent: 0:0e46349438790c460c5c9f7546bfcd39b267bbd2 | |
238 | parent: -1:0000000000000000000000000000000000000000 |
|
269 | parent: -1:0000000000000000000000000000000000000000 | |
239 | manifest: 1:895aa9b7886f89dd017a6d62524e1f9180b04df9 |
|
270 | manifest: 1:895aa9b7886f89dd017a6d62524e1f9180b04df9 | |
240 | user: test |
|
271 | user: test | |
241 | date: Sun Jan 02 00:00:00 2000 +0000 |
|
272 | date: Sun Jan 02 00:00:00 2000 +0000 | |
242 | files: foo |
|
273 | files: foo | |
243 | extra: branch=default |
|
274 | extra: branch=default | |
244 | description: |
|
275 | description: | |
245 | commit2 |
|
276 | commit2 | |
246 |
|
277 | |||
247 |
|
278 | |||
248 | result: 0 |
|
279 | result: 0 | |
249 | $ hg blackbox |
|
280 | $ hg blackbox | |
250 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updating the branch cache |
|
281 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updating the branch cache | |
251 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated served branch cache in * seconds (glob) |
|
282 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated served branch cache in * seconds (glob) | |
252 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote served branch cache with 1 labels and 1 nodes |
|
283 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote served branch cache with 1 labels and 1 nodes | |
253 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug commit -m commit2 -d 2000-01-02 foo exited 0 after *.?? seconds (glob) |
|
284 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug commit -m commit2 -d 2000-01-02 foo exited 0 after *.?? seconds (glob) | |
254 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0 |
|
285 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0 | |
255 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags |
|
286 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags | |
256 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0 exited 0 after *.?? seconds (glob) |
|
287 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0 exited 0 after *.?? seconds (glob) | |
257 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip |
|
288 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip | |
258 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip exited 0 after *.?? seconds (glob) |
|
289 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip exited 0 after *.?? seconds (glob) | |
259 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox |
|
290 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox | |
260 |
|
291 | |||
261 | Test log recursion from dirty status check |
|
292 | Test log recursion from dirty status check | |
262 |
|
293 | |||
263 | $ cat > ../r.py <<EOF |
|
294 | $ cat > ../r.py <<EOF | |
264 | > from mercurial import context, error, extensions |
|
295 | > from mercurial import context, error, extensions | |
265 | > x=[False] |
|
296 | > x=[False] | |
266 | > def status(orig, *args, **opts): |
|
297 | > def status(orig, *args, **opts): | |
267 | > args[0].repo().ui.log(b"broken", b"recursion?") |
|
298 | > args[0].repo().ui.log(b"broken", b"recursion?") | |
268 | > return orig(*args, **opts) |
|
299 | > return orig(*args, **opts) | |
269 | > def reposetup(ui, repo): |
|
300 | > def reposetup(ui, repo): | |
270 | > extensions.wrapfunction(context.basectx, 'status', status) |
|
301 | > extensions.wrapfunction(context.basectx, 'status', status) | |
271 | > EOF |
|
302 | > EOF | |
272 | $ hg id --config extensions.x=../r.py --config blackbox.dirty=True |
|
303 | $ hg id --config extensions.x=../r.py --config blackbox.dirty=True | |
273 | 45589e459b2e tip |
|
304 | 45589e459b2e tip | |
274 |
|
305 | |||
275 | cleanup |
|
306 | cleanup | |
276 | $ cd .. |
|
307 | $ cd .. | |
277 |
|
308 | |||
278 | #if chg |
|
309 | #if chg | |
279 |
|
310 | |||
280 | when using chg, blackbox.log should get rotated correctly |
|
311 | when using chg, blackbox.log should get rotated correctly | |
281 |
|
312 | |||
282 | $ cat > $TESTTMP/noop.py << EOF |
|
313 | $ cat > $TESTTMP/noop.py << EOF | |
283 | > from __future__ import absolute_import |
|
314 | > from __future__ import absolute_import | |
284 | > import time |
|
315 | > import time | |
285 | > from mercurial import registrar, scmutil |
|
316 | > from mercurial import registrar, scmutil | |
286 | > cmdtable = {} |
|
317 | > cmdtable = {} | |
287 | > command = registrar.command(cmdtable) |
|
318 | > command = registrar.command(cmdtable) | |
288 | > @command('noop') |
|
319 | > @command('noop') | |
289 | > def noop(ui, repo): |
|
320 | > def noop(ui, repo): | |
290 | > pass |
|
321 | > pass | |
291 | > EOF |
|
322 | > EOF | |
292 |
|
323 | |||
293 | $ hg init blackbox-chg |
|
324 | $ hg init blackbox-chg | |
294 | $ cd blackbox-chg |
|
325 | $ cd blackbox-chg | |
295 |
|
326 | |||
296 | $ cat > .hg/hgrc << EOF |
|
327 | $ cat > .hg/hgrc << EOF | |
297 | > [blackbox] |
|
328 | > [blackbox] | |
298 | > maxsize = 500B |
|
329 | > maxsize = 500B | |
299 | > [extensions] |
|
330 | > [extensions] | |
300 | > # extension change forces chg to restart |
|
331 | > # extension change forces chg to restart | |
301 | > noop=$TESTTMP/noop.py |
|
332 | > noop=$TESTTMP/noop.py | |
302 | > EOF |
|
333 | > EOF | |
303 |
|
334 | |||
304 | $ $PYTHON -c 'print("a" * 400)' > .hg/blackbox.log |
|
335 | $ $PYTHON -c 'print("a" * 400)' > .hg/blackbox.log | |
305 | $ chg noop |
|
336 | $ chg noop | |
306 | $ chg noop |
|
337 | $ chg noop | |
307 | $ chg noop |
|
338 | $ chg noop | |
308 | $ chg noop |
|
339 | $ chg noop | |
309 | $ chg noop |
|
340 | $ chg noop | |
310 |
|
341 | |||
311 | $ cat > showsize.py << 'EOF' |
|
342 | $ cat > showsize.py << 'EOF' | |
312 | > import os, sys |
|
343 | > import os, sys | |
313 | > limit = 500 |
|
344 | > limit = 500 | |
314 | > for p in sys.argv[1:]: |
|
345 | > for p in sys.argv[1:]: | |
315 | > size = os.stat(p).st_size |
|
346 | > size = os.stat(p).st_size | |
316 | > if size >= limit: |
|
347 | > if size >= limit: | |
317 | > desc = '>=' |
|
348 | > desc = '>=' | |
318 | > else: |
|
349 | > else: | |
319 | > desc = '<' |
|
350 | > desc = '<' | |
320 | > print('%s: %s %d' % (p, desc, limit)) |
|
351 | > print('%s: %s %d' % (p, desc, limit)) | |
321 | > EOF |
|
352 | > EOF | |
322 |
|
353 | |||
323 | $ $PYTHON showsize.py .hg/blackbox* |
|
354 | $ $PYTHON showsize.py .hg/blackbox* | |
324 | .hg/blackbox.log: < 500 |
|
355 | .hg/blackbox.log: < 500 | |
325 | .hg/blackbox.log.1: >= 500 |
|
356 | .hg/blackbox.log.1: >= 500 | |
326 | .hg/blackbox.log.2: >= 500 |
|
357 | .hg/blackbox.log.2: >= 500 | |
327 |
|
358 | |||
328 | $ cd .. |
|
359 | $ cd .. | |
329 |
|
360 | |||
330 | With chg, blackbox should not create the log file if the repo is gone |
|
361 | With chg, blackbox should not create the log file if the repo is gone | |
331 |
|
362 | |||
332 | $ hg init repo1 |
|
363 | $ hg init repo1 | |
333 | $ hg --config extensions.a=! -R repo1 log |
|
364 | $ hg --config extensions.a=! -R repo1 log | |
334 | $ rm -rf $TESTTMP/repo1 |
|
365 | $ rm -rf $TESTTMP/repo1 | |
335 | $ hg --config extensions.a=! init repo1 |
|
366 | $ hg --config extensions.a=! init repo1 | |
336 |
|
367 | |||
337 | #endif |
|
368 | #endif | |
338 |
|
369 | |||
339 | blackbox should work if repo.ui.log is not called (issue5518) |
|
370 | blackbox should work if repo.ui.log is not called (issue5518) | |
340 |
|
371 | |||
341 | $ cat > $TESTTMP/raise.py << EOF |
|
372 | $ cat > $TESTTMP/raise.py << EOF | |
342 | > from __future__ import absolute_import |
|
373 | > from __future__ import absolute_import | |
343 | > from mercurial import registrar, scmutil |
|
374 | > from mercurial import registrar, scmutil | |
344 | > cmdtable = {} |
|
375 | > cmdtable = {} | |
345 | > command = registrar.command(cmdtable) |
|
376 | > command = registrar.command(cmdtable) | |
346 | > @command(b'raise') |
|
377 | > @command(b'raise') | |
347 | > def raisecmd(*args): |
|
378 | > def raisecmd(*args): | |
348 | > raise RuntimeError('raise') |
|
379 | > raise RuntimeError('raise') | |
349 | > EOF |
|
380 | > EOF | |
350 |
|
381 | |||
351 | $ cat >> $HGRCPATH << EOF |
|
382 | $ cat >> $HGRCPATH << EOF | |
352 | > [blackbox] |
|
383 | > [blackbox] | |
353 | > track = commandexception |
|
384 | > track = commandexception | |
354 | > [extensions] |
|
385 | > [extensions] | |
355 | > raise=$TESTTMP/raise.py |
|
386 | > raise=$TESTTMP/raise.py | |
356 | > EOF |
|
387 | > EOF | |
357 |
|
388 | |||
358 | $ hg init $TESTTMP/blackbox-exception-only |
|
389 | $ hg init $TESTTMP/blackbox-exception-only | |
359 | $ cd $TESTTMP/blackbox-exception-only |
|
390 | $ cd $TESTTMP/blackbox-exception-only | |
360 |
|
391 | |||
361 | #if chg |
|
392 | #if chg | |
362 | (chg exits 255 because it fails to receive an exit code) |
|
393 | (chg exits 255 because it fails to receive an exit code) | |
363 | $ hg raise 2>/dev/null |
|
394 | $ hg raise 2>/dev/null | |
364 | [255] |
|
395 | [255] | |
365 | #else |
|
396 | #else | |
366 | (hg exits 1 because Python default exit code for uncaught exception is 1) |
|
397 | (hg exits 1 because Python default exit code for uncaught exception is 1) | |
367 | $ hg raise 2>/dev/null |
|
398 | $ hg raise 2>/dev/null | |
368 | [1] |
|
399 | [1] | |
369 | #endif |
|
400 | #endif | |
370 |
|
401 | |||
371 | $ head -1 .hg/blackbox.log |
|
402 | $ head -1 .hg/blackbox.log | |
372 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> ** Unknown exception encountered with possibly-broken third-party extension mock |
|
403 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> ** Unknown exception encountered with possibly-broken third-party extension mock | |
373 | $ tail -2 .hg/blackbox.log |
|
404 | $ tail -2 .hg/blackbox.log | |
374 | RuntimeError: raise |
|
405 | RuntimeError: raise | |
375 |
|
406 |
General Comments 0
You need to be logged in to leave comments.
Login now