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