Show More
@@ -1,139 +1,146 b'' | |||
|
1 | 1 | =================================== |
|
2 | 2 | Test the persistent on-disk nodemap |
|
3 | 3 | =================================== |
|
4 | 4 | |
|
5 | 5 | |
|
6 | 6 | $ hg init test-repo |
|
7 | 7 | $ cd test-repo |
|
8 | 8 | $ cat << EOF >> .hg/hgrc |
|
9 | 9 | > [experimental] |
|
10 | 10 | > exp-persistent-nodemap=yes |
|
11 | 11 | > [devel] |
|
12 | 12 | > persistent-nodemap=yes |
|
13 | 13 | > EOF |
|
14 | 14 | $ hg debugbuilddag .+5000 |
|
15 | 15 | $ hg debugnodemap --metadata |
|
16 | 16 | uid: ???????????????? (glob) |
|
17 | 17 | tip-rev: 5000 |
|
18 | 18 | data-length: 122880 |
|
19 | 19 | data-unused: 0 |
|
20 | 20 | $ f --size .hg/store/00changelog.n |
|
21 | 21 | .hg/store/00changelog.n: size=42 |
|
22 | ||
|
23 | Simple lookup works | |
|
24 | ||
|
25 | $ ANYNODE=`hg log --template '{node|short}\n' --rev tip` | |
|
26 | $ hg log -r "$ANYNODE" --template '{rev}\n' | |
|
27 | 5000 | |
|
28 | ||
|
22 | 29 | $ f --sha256 .hg/store/00changelog-*.nd |
|
23 | 30 | .hg/store/00changelog-????????????????.nd: sha256=b961925120e1c9bc345c199b2cc442abc477029fdece37ef9d99cbe59c0558b7 (glob) |
|
24 | 31 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
25 | 32 | size=122880, sha256=b961925120e1c9bc345c199b2cc442abc477029fdece37ef9d99cbe59c0558b7 |
|
26 | 33 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size |
|
27 | 34 | size=122880, sha256=b961925120e1c9bc345c199b2cc442abc477029fdece37ef9d99cbe59c0558b7 |
|
28 | 35 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
29 | 36 | 0010: ff ff ff ff ff ff ff ff ff ff fa c2 ff ff ff ff |................| |
|
30 | 37 | 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
31 | 38 | 0030: ff ff ff ff ff ff ed b3 ff ff ff ff ff ff ff ff |................| |
|
32 | 39 | 0040: ff ff ff ff ff ff ee 34 00 00 00 00 ff ff ff ff |.......4........| |
|
33 | 40 | 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
34 | 41 | 0060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
35 | 42 | 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
36 | 43 | 0080: ff ff ff ff ff ff f8 50 ff ff ff ff ff ff ff ff |.......P........| |
|
37 | 44 | 0090: ff ff ff ff ff ff ff ff ff ff ec c7 ff ff ff ff |................| |
|
38 | 45 | 00a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
39 | 46 | 00b0: ff ff ff ff ff ff fa be ff ff f2 fc ff ff ff ff |................| |
|
40 | 47 |
00c0: ff ff ff ff ff ff ef ea ff ff ff ff ff ff f9 17 | |
|
41 | 48 | 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
42 | 49 | 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
43 | 50 | 00f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
44 | 51 | $ hg debugnodemap --check |
|
45 | 52 | revision in index: 5001 |
|
46 | 53 | revision in nodemap: 5001 |
|
47 | 54 | |
|
48 | 55 | add a new commit |
|
49 | 56 | |
|
50 | 57 |
$ |
|
51 | 58 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
52 | 59 | $ echo foo > foo |
|
53 | 60 | $ hg add foo |
|
54 | 61 | $ hg ci -m 'foo' |
|
55 | 62 | |
|
56 | 63 | #if pure |
|
57 | 64 |
$ |
|
58 | 65 | uid: ???????????????? (glob) |
|
59 | 66 | tip-rev: 5001 |
|
60 | 67 | data-length: 123072 |
|
61 | 68 | data-unused: 192 |
|
62 | 69 | #else |
|
63 | 70 |
$ |
|
64 | 71 | uid: ???????????????? (glob) |
|
65 | 72 | tip-rev: 5001 |
|
66 | 73 | data-length: 122880 |
|
67 | 74 | data-unused: 0 |
|
68 | 75 | #endif |
|
69 | 76 |
$ |
|
70 | 77 | .hg/store/00changelog.n: size=42 |
|
71 | 78 | |
|
72 | 79 | (The pure code use the debug code that perform incremental update, the C code reencode from scratch) |
|
73 | 80 | |
|
74 | 81 | #if pure |
|
75 | 82 |
$ |
|
76 | 83 | .hg/store/00changelog-????????????????.nd: size=123072, sha256=136472751566c8198ff09e306a7d2f9bd18bd32298d614752b73da4d6df23340 (glob) |
|
77 | 84 | |
|
78 | 85 | #else |
|
79 | 86 |
$ |
|
80 | 87 | .hg/store/00changelog-????????????????.nd: size=122880, sha256=bfafebd751c4f6d116a76a37a1dee2a251747affe7efbcc4f4842ccc746d4db9 (glob) |
|
81 | 88 | |
|
82 | 89 | #endif |
|
83 | 90 | |
|
84 | 91 | $ hg debugnodemap --check |
|
85 | 92 | revision in index: 5002 |
|
86 | 93 | revision in nodemap: 5002 |
|
87 | 94 | |
|
88 | 95 | Test code path without mmap |
|
89 | 96 | --------------------------- |
|
90 | 97 | |
|
91 | 98 | $ echo bar > bar |
|
92 | 99 | $ hg add bar |
|
93 | 100 | $ hg ci -m 'bar' --config experimental.exp-persistent-nodemap.mmap=no |
|
94 | 101 | |
|
95 | 102 | $ hg debugnodemap --check --config experimental.exp-persistent-nodemap.mmap=yes |
|
96 | 103 | revision in index: 5003 |
|
97 | 104 | revision in nodemap: 5003 |
|
98 | 105 |
$ |
|
99 | 106 | revision in index: 5003 |
|
100 | 107 | revision in nodemap: 5003 |
|
101 | 108 | |
|
102 | 109 | |
|
103 | 110 | #if pure |
|
104 | 111 |
$ |
|
105 | 112 | uid: ???????????????? (glob) |
|
106 | 113 | tip-rev: 5002 |
|
107 | 114 | data-length: 123328 |
|
108 | 115 | data-unused: 384 |
|
109 | 116 |
$ |
|
110 | 117 | .hg/store/00changelog-????????????????.nd: size=123328, sha256=10d26e9776b6596af0f89143a54eba8cc581e929c38242a02a7b0760698c6c70 (glob) |
|
111 | 118 | |
|
112 | 119 | #else |
|
113 | 120 |
$ |
|
114 | 121 | uid: ???????????????? (glob) |
|
115 | 122 | tip-rev: 5002 |
|
116 | 123 | data-length: 122944 |
|
117 | 124 | data-unused: 0 |
|
118 | 125 |
$ |
|
119 | 126 | .hg/store/00changelog-????????????????.nd: size=122944, sha256=755976b22b64ab680401b45395953504e64e7fa8c31ac570f58dee21e15f9bc0 (glob) |
|
120 | 127 | #endif |
|
121 | 128 | |
|
122 | 129 | Test force warming the cache |
|
123 | 130 | |
|
124 | 131 | $ rm .hg/store/00changelog.n |
|
125 | 132 | $ hg debugnodemap --metadata |
|
126 | 133 | $ hg debugupdatecache |
|
127 | 134 | #if pure |
|
128 | 135 | $ hg debugnodemap --metadata |
|
129 | 136 | uid: ???????????????? (glob) |
|
130 | 137 | tip-rev: 5002 |
|
131 | 138 | data-length: 122944 |
|
132 | 139 | data-unused: 0 |
|
133 | 140 | #else |
|
134 | 141 |
$ |
|
135 | 142 | uid: ???????????????? (glob) |
|
136 | 143 | tip-rev: 5002 |
|
137 | 144 | data-length: 122944 |
|
138 | 145 | data-unused: 0 |
|
139 | 146 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now