Mercurial > hg
annotate tests/test-dirstate-status-write-race.t @ 50244:07d030b38097 stable
rust-dirstate-v2: don't write dirstate if data file has changed
This fixes the following race:
- process A reads the dirstate
- process B reads and writes the dirstate
- process A writes the dirstate
This either resulted in losing what process B had just written or a crash
because the `uuid` had changed and we were trying to write to a file that
doesn't exist. More explanations inside.
This doesn't fix the issue for dirstate-v1, a later patch addresses it.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Tue, 28 Feb 2023 17:58:15 +0100 |
parents | 53ca3e3bc013 |
children | dbe09fb038fc |
rev | line source |
---|---|
50215
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
1 ===================================================================== |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
2 Check potential race conditions between a status and other operations |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
3 ===================================================================== |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
4 |
50223
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
5 #testcases dirstate-v1 dirstate-v2-append dirstate-v2-rewrite |
50220
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
6 |
50215
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
7 The `hg status` command can run without the wlock, however it might end up |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
8 having to update the on-disk dirstate files, for example to mark ambiguous |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
9 files as clean, or to update directory caches information with dirstate-v2. |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
10 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
11 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
12 If another process updates the dirstate in the meantime we might run into |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
13 trouble. Especially, commands doing semantic changes like `hg add` or |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
14 `hg commit` should not see their update erased by a concurrent status. |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
15 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
16 Unlike commands like `add` or `commit`, `status` only writes the dirstate |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
17 to update caches, no actual information is lost if we fail to write to disk. |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
18 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
19 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
20 This test file is meant to test various cases where such parallel operations |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
21 between a status with reasons to update the dirstate and another semantic |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
22 changes happen. |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
23 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
24 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
25 Setup |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
26 ===== |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
27 |
50220
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
28 $ cat >> $HGRCPATH << EOF |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
29 > [storage] |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
30 > dirstate-v2.slow-path=allow |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
31 > EOF |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
32 |
50223
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
33 #if no-dirstate-v1 |
50220
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
34 $ cat >> $HGRCPATH << EOF |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
35 > [format] |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
36 > use-dirstate-v2=yes |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
37 > EOF |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
38 #else |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
39 $ cat >> $HGRCPATH << EOF |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
40 > [format] |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
41 > use-dirstate-v2=no |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
42 > EOF |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
43 #endif |
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
44 |
50223
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
45 #if dirstate-v2-rewrite |
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
46 $ d2args="--config devel.dirstate.v2.data_update_mode=force-new" |
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
47 #endif |
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
48 #if dirstate-v2-append |
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
49 $ d2args="--config devel.dirstate.v2.data_update_mode=force-append" |
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
50 #endif |
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
51 |
50215
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
52 $ directories="dir dir/nested dir2" |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
53 $ first_files="dir/nested/a dir/b dir/c dir/d dir2/e f" |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
54 $ second_files="g dir/nested/h dir/i dir/j dir2/k dir2/l dir/nested/m" |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
55 $ extra_files="dir/n dir/o p q" |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
56 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
57 $ hg init reference-repo |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
58 $ cd reference-repo |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
59 $ mkdir -p dir/nested dir2 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
60 $ touch -t 200001010000 $first_files $directories |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
61 $ hg commit -Aqm "recreate a bunch of files to facilitate dirstate-v2 append" |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
62 $ touch -t 200001010010 $second_files $directories |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
63 $ hg commit -Aqm "more files to have two commits" |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
64 $ hg log -G -v |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
65 @ changeset: 1:c349430a1631 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
66 | tag: tip |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
67 | user: test |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
68 | date: Thu Jan 01 00:00:00 1970 +0000 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
69 | files: dir/i dir/j dir/nested/h dir/nested/m dir2/k dir2/l g |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
70 | description: |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
71 | more files to have two commits |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
72 | |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
73 | |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
74 o changeset: 0:4f23db756b09 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
75 user: test |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
76 date: Thu Jan 01 00:00:00 1970 +0000 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
77 files: dir/b dir/c dir/d dir/nested/a dir2/e f |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
78 description: |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
79 recreate a bunch of files to facilitate dirstate-v2 append |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
80 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
81 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
82 $ hg manifest |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
83 dir/b |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
84 dir/c |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
85 dir/d |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
86 dir/i |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
87 dir/j |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
88 dir/nested/a |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
89 dir/nested/h |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
90 dir/nested/m |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
91 dir2/e |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
92 dir2/k |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
93 dir2/l |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
94 f |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
95 g |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
96 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
97 Add some unknown files and refresh the dirstate |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
98 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
99 $ touch -t 200001010020 $extra_files |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
100 $ hg add dir/o |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
101 $ hg remove dir/nested/m |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
102 |
50222
ecd28d89c29e
dirstate-v2: add devel config option to control write behavior
Raphaël Gomès <rgomes@octobus.net>
parents:
50220
diff
changeset
|
103 $ hg st --config devel.dirstate.v2.data_update_mode=force-new |
50215
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
104 A dir/o |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
105 R dir/nested/m |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
106 ? dir/n |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
107 ? p |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
108 ? q |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
109 $ hg debugstate |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
110 n 644 0 2000-01-01 00:00:00 dir/b |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
111 n 644 0 2000-01-01 00:00:00 dir/c |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
112 n 644 0 2000-01-01 00:00:00 dir/d |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
113 n 644 0 2000-01-01 00:10:00 dir/i |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
114 n 644 0 2000-01-01 00:10:00 dir/j |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
115 n 644 0 2000-01-01 00:00:00 dir/nested/a |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
116 n 644 0 2000-01-01 00:10:00 dir/nested/h |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
117 r ?????????????????????????????????? dir/nested/m (glob) |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
118 a ?????????????????????????????????? dir/o (glob) |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
119 n 644 0 2000-01-01 00:00:00 dir2/e |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
120 n 644 0 2000-01-01 00:10:00 dir2/k |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
121 n 644 0 2000-01-01 00:10:00 dir2/l |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
122 n 644 0 2000-01-01 00:00:00 f |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
123 n 644 0 2000-01-01 00:10:00 g |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
124 $ hg debugstate > ../reference |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
125 $ cd .. |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
126 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
127 Explain / verify the test principles |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
128 ------------------------------------ |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
129 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
130 First, we can properly copy the reference |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
131 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
132 $ cp -a reference-repo sanity-check |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
133 $ cd sanity-check |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
134 $ hg debugstate |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
135 n 644 0 2000-01-01 00:00:00 dir/b |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
136 n 644 0 2000-01-01 00:00:00 dir/c |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
137 n 644 0 2000-01-01 00:00:00 dir/d |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
138 n 644 0 2000-01-01 00:10:00 dir/i |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
139 n 644 0 2000-01-01 00:10:00 dir/j |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
140 n 644 0 2000-01-01 00:00:00 dir/nested/a |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
141 n 644 0 2000-01-01 00:10:00 dir/nested/h |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
142 r ?????????????????????????????????? dir/nested/m (glob) |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
143 a ?????????????????????????????????? dir/o (glob) |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
144 n 644 0 2000-01-01 00:00:00 dir2/e |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
145 n 644 0 2000-01-01 00:10:00 dir2/k |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
146 n 644 0 2000-01-01 00:10:00 dir2/l |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
147 n 644 0 2000-01-01 00:00:00 f |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
148 n 644 0 2000-01-01 00:10:00 g |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
149 $ hg debugstate > ../post-copy |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
150 $ diff ../reference ../post-copy |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
151 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
152 And status thinks the cache is in a proper state |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
153 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
154 $ hg st |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
155 A dir/o |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
156 R dir/nested/m |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
157 ? dir/n |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
158 ? p |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
159 ? q |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
160 $ hg debugstate |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
161 n 644 0 2000-01-01 00:00:00 dir/b |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
162 n 644 0 2000-01-01 00:00:00 dir/c |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
163 n 644 0 2000-01-01 00:00:00 dir/d |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
164 n 644 0 2000-01-01 00:10:00 dir/i |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
165 n 644 0 2000-01-01 00:10:00 dir/j |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
166 n 644 0 2000-01-01 00:00:00 dir/nested/a |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
167 n 644 0 2000-01-01 00:10:00 dir/nested/h |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
168 r ?????????????????????????????????? dir/nested/m (glob) |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
169 a ?????????????????????????????????? dir/o (glob) |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
170 n 644 0 2000-01-01 00:00:00 dir2/e |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
171 n 644 0 2000-01-01 00:10:00 dir2/k |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
172 n 644 0 2000-01-01 00:10:00 dir2/l |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
173 n 644 0 2000-01-01 00:00:00 f |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
174 n 644 0 2000-01-01 00:10:00 g |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
175 $ hg debugstate > ../post-status |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
176 $ diff ../reference ../post-status |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
177 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
178 Then we can start a status that: |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
179 - has some update to do (the touch call) |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
180 - will wait AFTER running status, but before updating the cache on disk |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
181 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
182 $ touch -t 200001010001 dir/c |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
183 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
184 > --config rhg.on-unsupported=abort \ |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
185 > --config devel.sync.status.pre-dirstate-write-file=$TESTTMP/status-race-lock \ |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
186 > & |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
187 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
188 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
189 We check it runs the status first by modifying a file and updating another timestamp |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
190 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
191 $ touch -t 200001010003 dir/i |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
192 $ echo babar > dir/j |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
193 $ touch $TESTTMP/status-race-lock |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
194 $ wait |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
195 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
196 The test process should have reported a status before the change we made, |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
197 and should have missed the timestamp update |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
198 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
199 $ cat $TESTTMP/status-race-lock.out |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
200 A dir/o |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
201 R dir/nested/m |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
202 ? dir/n |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
203 ? p |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
204 ? q |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
205 $ cat $TESTTMP/status-race-lock.log |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
206 $ hg debugstate | grep dir/c |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
207 n 644 0 2000-01-01 00:01:00 dir/c |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
208 $ hg debugstate | grep dir/i |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
209 n 644 0 2000-01-01 00:10:00 dir/i |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
210 $ hg debugstate | grep dir/j |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
211 n 644 0 2000-01-01 00:10:00 dir/j |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
212 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
213 final cleanup |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
214 |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
215 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
ae61851e6fe2
dirstate: add a way to test races happening during status
Raphaël Gomès <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
216 $ cd .. |
50216
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
217 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
218 Actual Testing |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
219 ============== |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
220 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
221 Race with a `hg add` |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
222 ------------------- |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
223 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
224 $ cp -a reference-repo race-with-add |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
225 $ cd race-with-add |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
226 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
227 spin a `hg status` with some caches to update |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
228 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
229 $ touch -t 200001020001 f |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
230 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
231 > --config rhg.on-unsupported=abort \ |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
232 > --config devel.sync.status.pre-dirstate-write-file=$TESTTMP/status-race-lock \ |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
233 > & |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
234 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
235 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
236 Add a file |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
237 |
50223
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
238 $ hg $d2args add dir/n |
50216
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
239 $ touch $TESTTMP/status-race-lock |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
240 $ wait |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
241 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
242 The file should in a "added" state |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
243 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
244 $ hg status |
50244
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
245 A dir/n (no-rhg dirstate-v1 !) |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
246 A dir/n (no-dirstate-v1 !) |
50220
35ea3c139104
dirstate: cover each dirstate version when testing for status race
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50219
diff
changeset
|
247 A dir/n (missing-correct-output rhg dirstate-v1 !) |
50216
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
248 A dir/o |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
249 R dir/nested/m |
50244
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
250 ? dir/n (known-bad-output rhg dirstate-v1 !) |
50216
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
251 ? p |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
252 ? q |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
253 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
254 The status process should return a consistent result and not crash. |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
255 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
256 $ cat $TESTTMP/status-race-lock.out |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
257 A dir/o |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
258 R dir/nested/m |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
259 ? dir/n |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
260 ? p |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
261 ? q |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
262 $ cat $TESTTMP/status-race-lock.log |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
263 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
264 final cleanup |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
265 |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
266 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
02bf2f94a04c
dirstate: test a `hg status` raced by a `hg add`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50215
diff
changeset
|
267 $ cd .. |
50217
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
268 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
269 Race with a `hg commit` |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
270 ---------------------- |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
271 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
272 $ cp -a reference-repo race-with-commit |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
273 $ cd race-with-commit |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
274 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
275 spin a `hg status` with some caches to update |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
276 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
277 $ touch -t 200001020001 dir/j |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
278 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
279 > --config rhg.on-unsupported=abort \ |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
280 > --config devel.sync.status.pre-dirstate-write-file=$TESTTMP/status-race-lock \ |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
281 > & |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
282 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
283 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
284 Add a file and force the data file rewrite |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
285 |
50223
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
286 $ hg $d2args commit -m created-during-status dir/o |
50217
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
287 $ touch $TESTTMP/status-race-lock |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
288 $ wait |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
289 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
290 The parent must change and the status should be clean |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
291 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
292 # XXX rhg misbehaves here |
50244
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
293 #if rhg dirstate-v1 |
50217
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
294 $ hg summary |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
295 parent: 1:c349430a1631 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
296 more files to have two commits |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
297 branch: default |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
298 commit: 1 added, 1 removed, 3 unknown (new branch head) |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
299 update: 1 new changesets (update) |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
300 phases: 3 draft |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
301 $ hg status |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
302 A dir/o |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
303 R dir/nested/m |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
304 ? dir/n |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
305 ? p |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
306 ? q |
50244
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
307 #else |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
308 $ hg summary |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
309 parent: 2:2e3b442a2fd4 tip |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
310 created-during-status |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
311 branch: default |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
312 commit: 1 removed, 3 unknown |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
313 update: (current) |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
314 phases: 3 draft |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
315 $ hg status |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
316 R dir/nested/m |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
317 ? dir/n |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
318 ? p |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
319 ? q |
50217
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
320 #endif |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
321 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
322 The status process should return a consistent result and not crash. |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
323 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
324 $ cat $TESTTMP/status-race-lock.out |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
325 A dir/o |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
326 R dir/nested/m |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
327 ? dir/n |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
328 ? p |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
329 ? q |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
330 $ cat $TESTTMP/status-race-lock.log |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
331 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
332 final cleanup |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
333 |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
334 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
335 $ cd .. |
718fcccae326
dirstate: test a `hg status` raced by a `hg commit`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50216
diff
changeset
|
336 |
50218
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
337 Race with a `hg update` |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
338 ---------------------- |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
339 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
340 $ cp -a reference-repo race-with-update |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
341 $ cd race-with-update |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
342 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
343 spin a `hg status` with some caches to update |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
344 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
345 $ touch -t 200001020001 dir2/k |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
346 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
347 > --config rhg.on-unsupported=abort \ |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
348 > --config devel.sync.status.pre-dirstate-write-file=$TESTTMP/status-race-lock \ |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
349 > & |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
350 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
351 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
352 Add a file and force the data file rewrite |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
353 |
50223
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
354 $ hg $d2args update ".~1" |
50218
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
355 0 files updated, 0 files merged, 6 files removed, 0 files unresolved |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
356 $ touch $TESTTMP/status-race-lock |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
357 $ wait |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
358 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
359 The parent must change and the status should be clean |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
360 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
361 $ hg summary |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
362 parent: 0:4f23db756b09 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
363 recreate a bunch of files to facilitate dirstate-v2 append |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
364 branch: default |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
365 commit: 1 added, 3 unknown (new branch head) |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
366 update: 1 new changesets (update) |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
367 phases: 2 draft |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
368 $ hg status |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
369 A dir/o |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
370 ? dir/n |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
371 ? p |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
372 ? q |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
373 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
374 The status process should return a consistent result and not crash. |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
375 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
376 $ cat $TESTTMP/status-race-lock.out |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
377 A dir/o |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
378 R dir/nested/m |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
379 ? dir/n |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
380 ? p |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
381 ? q |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
382 $ cat $TESTTMP/status-race-lock.log |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
383 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
384 final cleanup |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
385 |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
386 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
ee75dd844ab6
dirstate: test a `hg status` raced by a `hg update`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50217
diff
changeset
|
387 $ cd .. |
50219
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
388 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
389 Race with another status |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
390 ------------------------ |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
391 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
392 $ cp -a reference-repo race-with-status |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
393 $ cd race-with-status |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
394 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
395 spin a `hg status` with some caches to update |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
396 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
397 $ touch -t 200001010030 dir/nested/h |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
398 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
399 > --config rhg.on-unsupported=abort \ |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
400 > --config devel.sync.status.pre-dirstate-write-file=$TESTTMP/status-race-lock \ |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
401 > & |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
402 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
403 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
404 touch g |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
405 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
406 $ touch -t 200001010025 g |
50223
3f34d800cc69
dirstate: tests racing status with both dirstate-v2 append and rewrite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50222
diff
changeset
|
407 $ hg $d2args status |
50219
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
408 A dir/o |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
409 R dir/nested/m |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
410 ? dir/n |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
411 ? p |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
412 ? q |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
413 $ touch $TESTTMP/status-race-lock |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
414 $ wait |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
415 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
416 the first update should be on disk |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
417 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
418 $ hg debugstate --all | grep "g" |
50244
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
419 n 644 0 2000-01-01 00:10:00 g (known-bad-output rhg dirstate-v1 !) |
07d030b38097
rust-dirstate-v2: don't write dirstate if data file has changed
Raphaël Gomès <rgomes@octobus.net>
parents:
50225
diff
changeset
|
420 n 644 0 2000-01-01 00:25:00 g (rhg no-dirstate-v1 !) |
50219
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
421 n 644 0 2000-01-01 00:25:00 g (no-rhg !) |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
422 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
423 The status process should return a consistent result and not crash. |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
424 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
425 $ cat $TESTTMP/status-race-lock.out |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
426 A dir/o |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
427 R dir/nested/m |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
428 ? dir/n |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
429 ? p |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
430 ? q |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
431 $ cat $TESTTMP/status-race-lock.log |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
432 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
433 final cleanup |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
434 |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
435 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
72104dd91f2b
dirstate: test a `hg status` raced by another `hg status`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50218
diff
changeset
|
436 $ cd .. |
50224
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
437 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
438 Race with the removal of an ambiguous file |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
439 ----------------------รจ------------------- |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
440 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
441 $ cp -a reference-repo race-with-remove |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
442 $ cd race-with-remove |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
443 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
444 spin a `hg status` with some caches to update |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
445 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
446 $ touch -t 200001010035 dir2/l |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
447 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
448 > --config rhg.on-unsupported=abort \ |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
449 > --config devel.sync.status.pre-dirstate-write-file=$TESTTMP/status-race-lock \ |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
450 > & |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
451 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
452 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
453 remove that same file |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
454 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
455 $ hg $d2args remove dir2/l |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
456 $ touch $TESTTMP/status-race-lock |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
457 $ wait |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
458 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
459 file should be marked as removed |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
460 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
461 $ hg status |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
462 A dir/o |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
463 R dir/nested/m |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
464 R dir2/l |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
465 ? dir/n |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
466 ? p |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
467 ? q |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
468 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
469 The status process should return a consistent result and not crash. |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
470 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
471 $ cat $TESTTMP/status-race-lock.out |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
472 A dir/o |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
473 R dir/nested/m |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
474 ? dir/n |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
475 ? p |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
476 ? q |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
477 $ cat $TESTTMP/status-race-lock.log |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
478 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
479 final cleanup |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
480 |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
481 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
e30b9e43be7e
dirstate: test a `hg status` raced by a `hg remove`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50223
diff
changeset
|
482 $ cd .. |