Show More
@@ -0,0 +1,43 b'' | |||||
|
1 | $ cat >> $HGRCPATH << EOF | |||
|
2 | > [storage] | |||
|
3 | > dirstate-v2.slow-path=allow | |||
|
4 | > EOF | |||
|
5 | ||||
|
6 | Set up a v1 repo | |||
|
7 | ||||
|
8 | $ hg init repo | |||
|
9 | $ cd repo | |||
|
10 | $ echo a > a | |||
|
11 | $ hg add a | |||
|
12 | $ hg commit -m a | |||
|
13 | $ hg debugrequires | grep dirstate | |||
|
14 | [1] | |||
|
15 | $ ls -1 .hg/dirstate* | |||
|
16 | .hg/dirstate | |||
|
17 | ||||
|
18 | Copy v1 dirstate | |||
|
19 | $ cp .hg/dirstate $TESTTMP/dirstate-v1-backup | |||
|
20 | ||||
|
21 | Upgrade it to v2 | |||
|
22 | ||||
|
23 | $ hg debugupgraderepo -q --config format.use-dirstate-v2=1 --run | grep added | |||
|
24 | added: dirstate-v2 | |||
|
25 | $ hg debugrequires | grep dirstate | |||
|
26 | dirstate-v2 | |||
|
27 | $ ls -1 .hg/dirstate* | |||
|
28 | .hg/dirstate | |||
|
29 | .hg/dirstate.* (glob) | |||
|
30 | ||||
|
31 | Manually reset to dirstate v1 to simulate an incomplete dirstate-v2 upgrade | |||
|
32 | ||||
|
33 | $ rm .hg/dirstate* | |||
|
34 | $ cp $TESTTMP/dirstate-v1-backup .hg/dirstate | |||
|
35 | ||||
|
36 | There should be no errors, but a v2 dirstate should be written back to disk | |||
|
37 | $ hg st | |||
|
38 | abort: dirstate-v2 parse error: when reading docket, Expected at least * bytes, got * (glob) (known-bad-output !) | |||
|
39 | [255] | |||
|
40 | $ ls -1 .hg/dirstate* | |||
|
41 | .hg/dirstate | |||
|
42 | .hg/dirstate.* (glob) (missing-correct-output !) | |||
|
43 |
General Comments 0
You need to be logged in to leave comments.
Login now