Show More
@@ -1,102 +1,102 b'' | |||||
1 | #testcases dirstate-v1 dirstate-v2 |
|
1 | #testcases dirstate-v1 dirstate-v2 | |
2 |
|
2 | |||
3 | #if dirstate-v2 |
|
3 | #if dirstate-v2 | |
4 | #require rust |
|
4 | #require rust | |
5 | $ echo '[format]' >> $HGRCPATH |
|
5 | $ echo '[format]' >> $HGRCPATH | |
6 | $ echo 'exp-dirstate-v2=1' >> $HGRCPATH |
|
6 | $ echo 'exp-dirstate-v2=1' >> $HGRCPATH | |
7 | #endif |
|
7 | #endif | |
8 |
|
8 | |||
9 | ------ Test dirstate._dirs refcounting |
|
9 | ------ Test dirstate._dirs refcounting | |
10 |
|
10 | |||
11 | $ hg init t |
|
11 | $ hg init t | |
12 | $ cd t |
|
12 | $ cd t | |
13 | $ mkdir -p a/b/c/d |
|
13 | $ mkdir -p a/b/c/d | |
14 | $ touch a/b/c/d/x |
|
14 | $ touch a/b/c/d/x | |
15 | $ touch a/b/c/d/y |
|
15 | $ touch a/b/c/d/y | |
16 | $ touch a/b/c/d/z |
|
16 | $ touch a/b/c/d/z | |
17 | $ hg ci -Am m |
|
17 | $ hg ci -Am m | |
18 | adding a/b/c/d/x |
|
18 | adding a/b/c/d/x | |
19 | adding a/b/c/d/y |
|
19 | adding a/b/c/d/y | |
20 | adding a/b/c/d/z |
|
20 | adding a/b/c/d/z | |
21 | $ hg mv a z |
|
21 | $ hg mv a z | |
22 | moving a/b/c/d/x to z/b/c/d/x |
|
22 | moving a/b/c/d/x to z/b/c/d/x | |
23 | moving a/b/c/d/y to z/b/c/d/y |
|
23 | moving a/b/c/d/y to z/b/c/d/y | |
24 | moving a/b/c/d/z to z/b/c/d/z |
|
24 | moving a/b/c/d/z to z/b/c/d/z | |
25 |
|
25 | |||
26 | Test name collisions |
|
26 | Test name collisions | |
27 |
|
27 | |||
28 | $ rm z/b/c/d/x |
|
28 | $ rm z/b/c/d/x | |
29 | $ mkdir z/b/c/d/x |
|
29 | $ mkdir z/b/c/d/x | |
30 | $ touch z/b/c/d/x/y |
|
30 | $ touch z/b/c/d/x/y | |
31 | $ hg add z/b/c/d/x/y |
|
31 | $ hg add z/b/c/d/x/y | |
32 | abort: file 'z/b/c/d/x' in dirstate clashes with 'z/b/c/d/x/y' |
|
32 | abort: file 'z/b/c/d/x' in dirstate clashes with 'z/b/c/d/x/y' | |
33 | [255] |
|
33 | [255] | |
34 | $ rm -rf z/b/c/d |
|
34 | $ rm -rf z/b/c/d | |
35 | $ touch z/b/c/d |
|
35 | $ touch z/b/c/d | |
36 | $ hg add z/b/c/d |
|
36 | $ hg add z/b/c/d | |
37 | abort: directory 'z/b/c/d' already in dirstate |
|
37 | abort: directory 'z/b/c/d' already in dirstate | |
38 | [255] |
|
38 | [255] | |
39 |
|
39 | |||
40 | $ cd .. |
|
40 | $ cd .. | |
41 |
|
41 | |||
42 | Issue1790: dirstate entry locked into unset if file mtime is set into |
|
42 | Issue1790: dirstate entry locked into unset if file mtime is set into | |
43 | the future |
|
43 | the future | |
44 |
|
44 | |||
45 | Prepare test repo: |
|
45 | Prepare test repo: | |
46 |
|
46 | |||
47 | $ hg init u |
|
47 | $ hg init u | |
48 | $ cd u |
|
48 | $ cd u | |
49 | $ echo a > a |
|
49 | $ echo a > a | |
50 | $ hg add |
|
50 | $ hg add | |
51 | adding a |
|
51 | adding a | |
52 | $ hg ci -m1 |
|
52 | $ hg ci -m1 | |
53 |
|
53 | |||
54 | Set mtime of a into the future: |
|
54 | Set mtime of a into the future: | |
55 |
|
55 | |||
56 |
$ touch -t 20 |
|
56 | $ touch -t 203101011200 a | |
57 |
|
57 | |||
58 | Status must not set a's entry to unset (issue1790): |
|
58 | Status must not set a's entry to unset (issue1790): | |
59 |
|
59 | |||
60 | $ hg status |
|
60 | $ hg status | |
61 | $ hg debugstate |
|
61 | $ hg debugstate | |
62 |
n 644 2 20 |
|
62 | n 644 2 2031-01-01 12:00:00 a | |
63 |
|
63 | |||
64 | Test modulo storage/comparison of absurd dates: |
|
64 | Test modulo storage/comparison of absurd dates: | |
65 |
|
65 | |||
66 | #if no-aix |
|
66 | #if no-aix | |
67 | $ touch -t 195001011200 a |
|
67 | $ touch -t 195001011200 a | |
68 | $ hg st |
|
68 | $ hg st | |
69 | $ hg debugstate |
|
69 | $ hg debugstate | |
70 | n 644 2 2018-01-19 15:14:08 a |
|
70 | n 644 2 2018-01-19 15:14:08 a | |
71 | #endif |
|
71 | #endif | |
72 |
|
72 | |||
73 | Verify that exceptions during a dirstate change leave the dirstate |
|
73 | Verify that exceptions during a dirstate change leave the dirstate | |
74 | coherent (issue4353) |
|
74 | coherent (issue4353) | |
75 |
|
75 | |||
76 | $ cat > ../dirstateexception.py <<EOF |
|
76 | $ cat > ../dirstateexception.py <<EOF | |
77 | > from __future__ import absolute_import |
|
77 | > from __future__ import absolute_import | |
78 | > from mercurial import ( |
|
78 | > from mercurial import ( | |
79 | > error, |
|
79 | > error, | |
80 | > extensions, |
|
80 | > extensions, | |
81 | > mergestate as mergestatemod, |
|
81 | > mergestate as mergestatemod, | |
82 | > ) |
|
82 | > ) | |
83 | > |
|
83 | > | |
84 | > def wraprecordupdates(*args): |
|
84 | > def wraprecordupdates(*args): | |
85 | > raise error.Abort(b"simulated error while recording dirstateupdates") |
|
85 | > raise error.Abort(b"simulated error while recording dirstateupdates") | |
86 | > |
|
86 | > | |
87 | > def reposetup(ui, repo): |
|
87 | > def reposetup(ui, repo): | |
88 | > extensions.wrapfunction(mergestatemod, 'recordupdates', |
|
88 | > extensions.wrapfunction(mergestatemod, 'recordupdates', | |
89 | > wraprecordupdates) |
|
89 | > wraprecordupdates) | |
90 | > EOF |
|
90 | > EOF | |
91 |
|
91 | |||
92 | $ hg rm a |
|
92 | $ hg rm a | |
93 | $ hg commit -m 'rm a' |
|
93 | $ hg commit -m 'rm a' | |
94 | $ echo "[extensions]" >> .hg/hgrc |
|
94 | $ echo "[extensions]" >> .hg/hgrc | |
95 | $ echo "dirstateex=../dirstateexception.py" >> .hg/hgrc |
|
95 | $ echo "dirstateex=../dirstateexception.py" >> .hg/hgrc | |
96 | $ hg up 0 |
|
96 | $ hg up 0 | |
97 | abort: simulated error while recording dirstateupdates |
|
97 | abort: simulated error while recording dirstateupdates | |
98 | [255] |
|
98 | [255] | |
99 | $ hg log -r . -T '{rev}\n' |
|
99 | $ hg log -r . -T '{rev}\n' | |
100 | 1 |
|
100 | 1 | |
101 | $ hg status |
|
101 | $ hg status | |
102 | ? a |
|
102 | ? a |
General Comments 0
You need to be logged in to leave comments.
Login now