Show More
@@ -1,101 +1,94 b'' | |||
|
1 | 1 | #testcases skip-detection fail-if-detected |
|
2 | 2 | |
|
3 | 3 | Test situations that "should" only be reproducible: |
|
4 | 4 | - on networked filesystems, or |
|
5 | 5 | - user using `hg debuglocks` to eliminate the lock file, or |
|
6 | 6 | - something (that doesn't respect the lock file) writing to the .hg directory |
|
7 | 7 | while we're running |
|
8 | 8 | |
|
9 | 9 | $ hg init a |
|
10 | 10 | $ cd a |
|
11 | 11 | |
|
12 | 12 | $ cat > "$TESTTMP/waitlock_editor.sh" <<EOF |
|
13 | 13 | > [ -n "\${WAITLOCK_ANNOUNCE:-}" ] && touch "\${WAITLOCK_ANNOUNCE}" |
|
14 | 14 | > f="\${WAITLOCK_FILE}" |
|
15 | 15 | > start=\`date +%s\` |
|
16 | 16 | > timeout=5 |
|
17 | > while [ \\( ! -f \$f \\) -a \\( ! -L \$f \\) ]; do | |
|
18 | > now=\`date +%s\` | |
|
19 | > if [ "\`expr \$now - \$start\`" -gt \$timeout ]; then | |
|
20 | > echo "timeout: \$f was not created in \$timeout seconds (it is now \$(date +%s))" | |
|
21 | > exit 1 | |
|
22 | > fi | |
|
23 | > sleep 0.1 | |
|
24 | > done | |
|
17 | > $RUNTESTDIR/testlib/wait-on-file "\$timeout" "\$f" | |
|
25 | 18 |
> if [ \$# -gt |
|
26 | 19 |
> cat |
|
27 | 20 | > fi |
|
28 | 21 | > EOF |
|
29 | 22 | |
|
30 | 23 |
|
|
31 | 24 |
this all starts, so let' |
|
32 | 25 | |
|
33 | 26 |
$ |
|
34 | 27 |
$ |
|
35 | 28 | |
|
36 | 29 |
|
|
37 | 30 | $ EDITOR_STARTED="$(pwd)/.editor_started" |
|
38 | 31 | $ MISCHIEF_MANAGED="$(pwd)/.mischief_managed" |
|
39 | 32 | $ JOBS_FINISHED="$(pwd)/.jobs_finished" |
|
40 | 33 | |
|
41 | 34 | #if fail-if-detected |
|
42 | 35 | $ cat >> .hg/hgrc << EOF |
|
43 | 36 | > [debug] |
|
44 | 37 | > revlog.verifyposition.changelog = fail |
|
45 | 38 | > EOF |
|
46 | 39 | #endif |
|
47 | 40 | |
|
48 | 41 |
$ echo |
|
49 | 42 | $ (WAITLOCK_ANNOUNCE="${EDITOR_STARTED}" \ |
|
50 | 43 | > WAITLOCK_FILE="${MISCHIEF_MANAGED}" \ |
|
51 | 44 | > HGEDITOR="sh $TESTTMP/waitlock_editor.sh" \ |
|
52 | 45 |
> hg |
|
53 | 46 | |
|
54 | 47 |
Wait |
|
55 | 48 |
$ |
|
56 | 49 | |
|
57 | 50 |
|
|
58 | 51 |
$ |
|
59 | 52 |
$ |
|
60 | 53 |
$ |
|
61 | 54 |
$ |
|
62 | 55 |
|
|
63 | 56 |
|
|
64 | 57 |
|
|
65 | 58 | |
|
66 | 59 |
|
|
67 | 60 |
$ |
|
68 | 61 |
|
|
69 | 62 |
$ |
|
70 | 63 | |
|
71 | 64 | #if skip-detection |
|
72 | 65 |
(Ensure |
|
73 | 66 |
|
|
74 | 67 |
|
|
75 | 68 | happen for the changelog (the linkrev should always refer to itself). |
|
76 | 69 | $ hg debugrevlogindex -c |
|
77 | 70 | rev linkrev nodeid p1 p2 |
|
78 | 71 | 0 0 222799e2f90b 000000000000 000000000000 |
|
79 | 72 | 1 1 6f124f6007a0 222799e2f90b 000000000000 |
|
80 | 73 | 2 1 ac80e6205bb2 222799e2f90b 000000000000 |
|
81 | 74 | #endif |
|
82 | 75 | |
|
83 | 76 | #if fail-if-detected |
|
84 | 77 | $ cat .foo_commit_out |
|
85 | 78 | transaction abort! |
|
86 | 79 | rollback completed |
|
87 | 80 | note: commit message saved in .hg/last-message.txt |
|
88 | 81 |
note: use ' |
|
89 | 82 | abort: 00changelog.i: file cursor at position 249, expected 121 |
|
90 | 83 | And no corruption in the changelog. |
|
91 | 84 | $ hg debugrevlogindex -c |
|
92 | 85 | rev linkrev nodeid p1 p2 |
|
93 | 86 | 0 0 222799e2f90b 000000000000 000000000000 |
|
94 | 87 | 1 1 6f124f6007a0 222799e2f90b 000000000000 (missing-correct-output !) |
|
95 | 88 |
And, because of transactions, there' |
|
96 | 89 |
$ |
|
97 | 90 |
|
|
98 | 91 |
|
|
99 | 92 |
|
|
100 | 93 | #endif |
|
101 | 94 |
General Comments 0
You need to be logged in to leave comments.
Login now