Mercurial > hg
annotate tests/test-simple-update.t @ 34107:4f60720cf0df
blackbox: fix rotation with chg
The added test will show:
$ $PYTHON showsize.py .hg/blackbox*
.hg/blackbox.log: < 500
.hg/blackbox.log.1: < 500
.hg/blackbox.log.2: < 500
.hg/blackbox.log.3: < 500
.hg/blackbox.log.4: < 500
.hg/blackbox.log.5: >= 500
with previous code.
The issue is caused by blackbox caching file objects *by path*, and the
rotation size check could run on a wrong file object (i.e. it should check
"blackbox.log", but `filehandles["blackbox.log"]` contains a file object
that has been renamed to "blackbox.log.5").
This patch removes the "filehandlers" global cache added by 45313f5a3a8c to
solve the issue.
I think the original patch was trying to make different ui objects use a same
file object if their blackbox.log path is the same. In theory it could also
be problematic in the rotation case. Anyway, that should become unnecessary
after D650.
Differential Revision: https://phab.mercurial-scm.org/D648
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 06 Sep 2017 19:27:30 -0700 |
parents | 75be14993fda |
children | eb586ed5d8ce |
rev | line source |
---|---|
13956
ffb5c09ba822
tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents:
12365
diff
changeset
|
1 $ hg init test |
12279 | 2 $ cd test |
3 $ echo foo>foo | |
4 $ hg addremove | |
5 adding foo | |
6 $ hg commit -m "1" | |
331 | 7 |
12279 | 8 $ hg verify |
9 checking changesets | |
10 checking manifests | |
11 crosschecking files in changesets and manifests | |
12 checking files | |
13 1 files, 1 changesets, 1 total revisions | |
14 | |
15 $ hg clone . ../branch | |
16 updating to branch default | |
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
18 $ cd ../branch | |
19 $ hg co | |
20 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
21 $ echo bar>>foo | |
22 $ hg commit -m "2" | |
331 | 23 |
12279 | 24 $ cd ../test |
25 | |
26 $ hg pull ../branch | |
27 pulling from ../branch | |
28 searching for changes | |
29 adding changesets | |
30 adding manifests | |
31 adding file changes | |
32 added 1 changesets with 1 changes to 1 files | |
33 (run 'hg update' to get a working copy) | |
331 | 34 |
12279 | 35 $ hg verify |
36 checking changesets | |
37 checking manifests | |
38 crosschecking files in changesets and manifests | |
39 checking files | |
40 1 files, 2 changesets, 2 total revisions | |
41 | |
42 $ hg co | |
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
44 | |
45 $ cat foo | |
46 foo | |
47 bar | |
48 | |
49 $ hg manifest --debug | |
50 6f4310b00b9a147241b071a60c28a650827fb03d 644 foo | |
51 | |
13960
190e5f2043d9
update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents:
13956
diff
changeset
|
52 update to rev 0 with a date |
190e5f2043d9
update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents:
13956
diff
changeset
|
53 |
190e5f2043d9
update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents:
13956
diff
changeset
|
54 $ hg upd -d foo 0 |
190e5f2043d9
update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents:
13956
diff
changeset
|
55 abort: you can't specify a revision and a date |
190e5f2043d9
update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents:
13956
diff
changeset
|
56 [255] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
13960
diff
changeset
|
57 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
13960
diff
changeset
|
58 $ cd .. |
31117
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
59 |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
60 update with worker processes |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
61 |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
62 #if no-windows |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
63 |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
64 $ cat <<EOF > forceworker.py |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
65 > from mercurial import extensions, worker |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
66 > def nocost(orig, ui, costperop, nops): |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
67 > return worker._numworkers(ui) > 1 |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
68 > def uisetup(ui): |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
69 > extensions.wrapfunction(worker, 'worthwhile', nocost) |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
70 > EOF |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
71 |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
72 $ hg init worker |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
73 $ cd worker |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
74 $ cat <<EOF >> .hg/hgrc |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
75 > [extensions] |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
76 > forceworker = $TESTTMP/forceworker.py |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
77 > [worker] |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
78 > numcpus = 4 |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
79 > EOF |
32940
75be14993fda
cleanup: use $PYTHON to run python in many more tests
Augie Fackler <augie@google.com>
parents:
31118
diff
changeset
|
80 $ for i in `$PYTHON $TESTDIR/seq.py 1 100`; do |
31117
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
81 > echo $i > $i |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
82 > done |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
83 $ hg ci -qAm 'add 100 files' |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
84 |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
85 $ hg update null |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
86 0 files updated, 0 files merged, 100 files removed, 0 files unresolved |
31118
a91c62752d08
worker: flush messages written by child processes before exit
Yuya Nishihara <yuya@tcha.org>
parents:
31117
diff
changeset
|
87 $ hg update -v | grep 100 |
a91c62752d08
worker: flush messages written by child processes before exit
Yuya Nishihara <yuya@tcha.org>
parents:
31117
diff
changeset
|
88 getting 100 |
31117
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
89 100 files updated, 0 files merged, 0 files removed, 0 files unresolved |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
90 |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
91 $ cd .. |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
92 |
92bca12328d1
worker: add basic test to ensure child processes are managed well
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
93 #endif |