Show More
@@ -1,777 +1,834 b'' | |||||
1 | =================================== |
|
1 | =================================== | |
2 | Test the persistent on-disk nodemap |
|
2 | Test the persistent on-disk nodemap | |
3 | =================================== |
|
3 | =================================== | |
4 |
|
4 | |||
5 |
|
5 | |||
6 | #if no-rust |
|
6 | #if no-rust | |
7 |
|
7 | |||
8 | $ cat << EOF >> $HGRCPATH |
|
8 | $ cat << EOF >> $HGRCPATH | |
9 | > [format] |
|
9 | > [format] | |
10 | > use-persistent-nodemap=yes |
|
10 | > use-persistent-nodemap=yes | |
11 | > [devel] |
|
11 | > [devel] | |
12 | > persistent-nodemap=yes |
|
12 | > persistent-nodemap=yes | |
13 | > EOF |
|
13 | > EOF | |
14 |
|
14 | |||
15 | #endif |
|
15 | #endif | |
16 |
|
16 | |||
17 | $ hg init test-repo --config storage.revlog.persistent-nodemap.slow-path=allow |
|
17 | $ hg init test-repo --config storage.revlog.persistent-nodemap.slow-path=allow | |
18 | $ cd test-repo |
|
18 | $ cd test-repo | |
19 |
|
19 | |||
20 | Check handling of the default slow-path value |
|
20 | Check handling of the default slow-path value | |
21 |
|
21 | |||
22 | #if no-pure no-rust |
|
22 | #if no-pure no-rust | |
23 |
|
23 | |||
24 | $ hg id |
|
24 | $ hg id | |
25 | abort: accessing `persistent-nodemap` repository without associated fast implementation. |
|
25 | abort: accessing `persistent-nodemap` repository without associated fast implementation. | |
26 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
26 | (check `hg help config.format.use-persistent-nodemap` for details) | |
27 | [255] |
|
27 | [255] | |
28 |
|
28 | |||
29 | Unlock further check (we are here to test the feature) |
|
29 | Unlock further check (we are here to test the feature) | |
30 |
|
30 | |||
31 | $ cat << EOF >> $HGRCPATH |
|
31 | $ cat << EOF >> $HGRCPATH | |
32 | > [storage] |
|
32 | > [storage] | |
33 | > # to avoid spamming the test |
|
33 | > # to avoid spamming the test | |
34 | > revlog.persistent-nodemap.slow-path=allow |
|
34 | > revlog.persistent-nodemap.slow-path=allow | |
35 | > EOF |
|
35 | > EOF | |
36 |
|
36 | |||
37 | #endif |
|
37 | #endif | |
38 |
|
38 | |||
39 | #if rust |
|
39 | #if rust | |
40 |
|
40 | |||
41 | Regression test for a previous bug in Rust/C FFI for the `Revlog_CAPI` capsule: |
|
41 | Regression test for a previous bug in Rust/C FFI for the `Revlog_CAPI` capsule: | |
42 | in places where `mercurial/cext/revlog.c` function signatures use `Py_ssize_t` |
|
42 | in places where `mercurial/cext/revlog.c` function signatures use `Py_ssize_t` | |
43 | (64 bits on Linux x86_64), corresponding declarations in `rust/hg-cpython/src/cindex.rs` |
|
43 | (64 bits on Linux x86_64), corresponding declarations in `rust/hg-cpython/src/cindex.rs` | |
44 | incorrectly used `libc::c_int` (32 bits). |
|
44 | incorrectly used `libc::c_int` (32 bits). | |
45 | As a result, -1 passed from Rust for the null revision became 4294967295 in C. |
|
45 | As a result, -1 passed from Rust for the null revision became 4294967295 in C. | |
46 |
|
46 | |||
47 | $ hg log -r 00000000 |
|
47 | $ hg log -r 00000000 | |
48 | changeset: -1:000000000000 |
|
48 | changeset: -1:000000000000 | |
49 | tag: tip |
|
49 | tag: tip | |
50 | user: |
|
50 | user: | |
51 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
51 | date: Thu Jan 01 00:00:00 1970 +0000 | |
52 |
|
52 | |||
53 |
|
53 | |||
54 | #endif |
|
54 | #endif | |
55 |
|
55 | |||
56 |
|
56 | |||
57 | $ hg debugformat |
|
57 | $ hg debugformat | |
58 | format-variant repo |
|
58 | format-variant repo | |
59 | fncache: yes |
|
59 | fncache: yes | |
60 | dotencode: yes |
|
60 | dotencode: yes | |
61 | generaldelta: yes |
|
61 | generaldelta: yes | |
62 | share-safe: no |
|
62 | share-safe: no | |
63 | sparserevlog: yes |
|
63 | sparserevlog: yes | |
64 | persistent-nodemap: yes |
|
64 | persistent-nodemap: yes | |
65 | copies-sdc: no |
|
65 | copies-sdc: no | |
66 | revlog-v2: no |
|
66 | revlog-v2: no | |
67 | plain-cl-delta: yes |
|
67 | plain-cl-delta: yes | |
68 | compression: zlib (no-zstd !) |
|
68 | compression: zlib (no-zstd !) | |
69 | compression: zstd (zstd !) |
|
69 | compression: zstd (zstd !) | |
70 | compression-level: default |
|
70 | compression-level: default | |
71 | $ hg debugbuilddag .+5000 --new-file |
|
71 | $ hg debugbuilddag .+5000 --new-file | |
72 |
|
72 | |||
73 | $ hg debugnodemap --metadata |
|
73 | $ hg debugnodemap --metadata | |
74 | uid: ???????????????? (glob) |
|
74 | uid: ???????????????? (glob) | |
75 | tip-rev: 5000 |
|
75 | tip-rev: 5000 | |
76 | tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c |
|
76 | tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c | |
77 | data-length: 121088 |
|
77 | data-length: 121088 | |
78 | data-unused: 0 |
|
78 | data-unused: 0 | |
79 | data-unused: 0.000% |
|
79 | data-unused: 0.000% | |
80 | $ f --size .hg/store/00changelog.n |
|
80 | $ f --size .hg/store/00changelog.n | |
81 | .hg/store/00changelog.n: size=70 |
|
81 | .hg/store/00changelog.n: size=70 | |
82 |
|
82 | |||
83 | Simple lookup works |
|
83 | Simple lookup works | |
84 |
|
84 | |||
85 | $ ANYNODE=`hg log --template '{node|short}\n' --rev tip` |
|
85 | $ ANYNODE=`hg log --template '{node|short}\n' --rev tip` | |
86 | $ hg log -r "$ANYNODE" --template '{rev}\n' |
|
86 | $ hg log -r "$ANYNODE" --template '{rev}\n' | |
87 | 5000 |
|
87 | 5000 | |
88 |
|
88 | |||
89 |
|
89 | |||
90 | #if rust |
|
90 | #if rust | |
91 |
|
91 | |||
92 | $ f --sha256 .hg/store/00changelog-*.nd |
|
92 | $ f --sha256 .hg/store/00changelog-*.nd | |
93 | .hg/store/00changelog-????????????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob) |
|
93 | .hg/store/00changelog-????????????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob) | |
94 |
|
94 | |||
95 | $ f --sha256 .hg/store/00manifest-*.nd |
|
95 | $ f --sha256 .hg/store/00manifest-*.nd | |
96 | .hg/store/00manifest-????????????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob) |
|
96 | .hg/store/00manifest-????????????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob) | |
97 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
97 | $ hg debugnodemap --dump-new | f --sha256 --size | |
98 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd |
|
98 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd | |
99 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size |
|
99 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size | |
100 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd |
|
100 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd | |
101 | 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........| |
|
101 | 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........| | |
102 | 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."| |
|
102 | 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."| | |
103 | 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^| |
|
103 | 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^| | |
104 | 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....| |
|
104 | 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....| | |
105 | 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8| |
|
105 | 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8| | |
106 | 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i| |
|
106 | 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i| | |
107 | 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....| |
|
107 | 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....| | |
108 | 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........| |
|
108 | 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........| | |
109 | 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....| |
|
109 | 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....| | |
110 | 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................| |
|
110 | 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................| | |
111 | 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+| |
|
111 | 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+| | |
112 | 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................| |
|
112 | 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................| | |
113 | 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5| |
|
113 | 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5| | |
114 | 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U| |
|
114 | 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U| | |
115 | 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................| |
|
115 | 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................| | |
116 | 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................| |
|
116 | 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................| | |
117 |
|
117 | |||
118 |
|
118 | |||
119 | #else |
|
119 | #else | |
120 |
|
120 | |||
121 | $ f --sha256 .hg/store/00changelog-*.nd |
|
121 | $ f --sha256 .hg/store/00changelog-*.nd | |
122 | .hg/store/00changelog-????????????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob) |
|
122 | .hg/store/00changelog-????????????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob) | |
123 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
123 | $ hg debugnodemap --dump-new | f --sha256 --size | |
124 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 |
|
124 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 | |
125 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size |
|
125 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size | |
126 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 |
|
126 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 | |
127 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
127 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
128 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
128 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
129 | 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................| |
|
129 | 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................| | |
130 | 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
130 | 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
131 | 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
131 | 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
132 | 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................| |
|
132 | 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................| | |
133 | 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............| |
|
133 | 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............| | |
134 | 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
134 | 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
135 | 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
135 | 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
136 | 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................| |
|
136 | 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................| | |
137 | 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........| |
|
137 | 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........| | |
138 | 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
138 | 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
139 | 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
139 | 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
140 | 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
140 | 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
141 | 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................| |
|
141 | 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................| | |
142 | 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................| |
|
142 | 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................| | |
143 |
|
143 | |||
144 | #endif |
|
144 | #endif | |
145 |
|
145 | |||
146 | $ hg debugnodemap --check |
|
146 | $ hg debugnodemap --check | |
147 | revision in index: 5001 |
|
147 | revision in index: 5001 | |
148 | revision in nodemap: 5001 |
|
148 | revision in nodemap: 5001 | |
149 |
|
149 | |||
150 | add a new commit |
|
150 | add a new commit | |
151 |
|
151 | |||
152 | $ hg up |
|
152 | $ hg up | |
153 | 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
153 | 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
154 | $ echo foo > foo |
|
154 | $ echo foo > foo | |
155 | $ hg add foo |
|
155 | $ hg add foo | |
156 |
|
156 | |||
157 |
|
157 | |||
158 | Check slow-path config value handling |
|
158 | Check slow-path config value handling | |
159 | ------------------------------------- |
|
159 | ------------------------------------- | |
160 |
|
160 | |||
161 | #if no-pure no-rust |
|
161 | #if no-pure no-rust | |
162 |
|
162 | |||
163 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" |
|
163 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" | |
164 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" |
|
164 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" | |
165 | falling back to default value: abort |
|
165 | falling back to default value: abort | |
166 | abort: accessing `persistent-nodemap` repository without associated fast implementation. |
|
166 | abort: accessing `persistent-nodemap` repository without associated fast implementation. | |
167 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
167 | (check `hg help config.format.use-persistent-nodemap` for details) | |
168 | [255] |
|
168 | [255] | |
169 |
|
169 | |||
170 | $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn" |
|
170 | $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn" | |
171 | warning: accessing `persistent-nodemap` repository without associated fast implementation. |
|
171 | warning: accessing `persistent-nodemap` repository without associated fast implementation. | |
172 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
172 | (check `hg help config.format.use-persistent-nodemap` for details) | |
173 | changeset: 5000:6b02b8c7b966 |
|
173 | changeset: 5000:6b02b8c7b966 | |
174 | tag: tip |
|
174 | tag: tip | |
175 | user: debugbuilddag |
|
175 | user: debugbuilddag | |
176 | date: Thu Jan 01 01:23:20 1970 +0000 |
|
176 | date: Thu Jan 01 01:23:20 1970 +0000 | |
177 | summary: r5000 |
|
177 | summary: r5000 | |
178 |
|
178 | |||
179 | $ hg ci -m 'foo' --config "storage.revlog.persistent-nodemap.slow-path=abort" |
|
179 | $ hg ci -m 'foo' --config "storage.revlog.persistent-nodemap.slow-path=abort" | |
180 | abort: accessing `persistent-nodemap` repository without associated fast implementation. |
|
180 | abort: accessing `persistent-nodemap` repository without associated fast implementation. | |
181 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
181 | (check `hg help config.format.use-persistent-nodemap` for details) | |
182 | [255] |
|
182 | [255] | |
183 |
|
183 | |||
184 | #else |
|
184 | #else | |
185 |
|
185 | |||
186 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" |
|
186 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" | |
187 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" |
|
187 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" | |
188 | falling back to default value: abort |
|
188 | falling back to default value: abort | |
189 | 6b02b8c7b966+ tip |
|
189 | 6b02b8c7b966+ tip | |
190 |
|
190 | |||
191 | #endif |
|
191 | #endif | |
192 |
|
192 | |||
193 | $ hg ci -m 'foo' |
|
193 | $ hg ci -m 'foo' | |
194 |
|
194 | |||
195 | #if no-pure no-rust |
|
195 | #if no-pure no-rust | |
196 | $ hg debugnodemap --metadata |
|
196 | $ hg debugnodemap --metadata | |
197 | uid: ???????????????? (glob) |
|
197 | uid: ???????????????? (glob) | |
198 | tip-rev: 5001 |
|
198 | tip-rev: 5001 | |
199 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c |
|
199 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c | |
200 | data-length: 121088 |
|
200 | data-length: 121088 | |
201 | data-unused: 0 |
|
201 | data-unused: 0 | |
202 | data-unused: 0.000% |
|
202 | data-unused: 0.000% | |
203 | #else |
|
203 | #else | |
204 | $ hg debugnodemap --metadata |
|
204 | $ hg debugnodemap --metadata | |
205 | uid: ???????????????? (glob) |
|
205 | uid: ???????????????? (glob) | |
206 | tip-rev: 5001 |
|
206 | tip-rev: 5001 | |
207 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c |
|
207 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c | |
208 | data-length: 121344 |
|
208 | data-length: 121344 | |
209 | data-unused: 256 |
|
209 | data-unused: 256 | |
210 | data-unused: 0.211% |
|
210 | data-unused: 0.211% | |
211 | #endif |
|
211 | #endif | |
212 |
|
212 | |||
213 | $ f --size .hg/store/00changelog.n |
|
213 | $ f --size .hg/store/00changelog.n | |
214 | .hg/store/00changelog.n: size=70 |
|
214 | .hg/store/00changelog.n: size=70 | |
215 |
|
215 | |||
216 | (The pure code use the debug code that perform incremental update, the C code reencode from scratch) |
|
216 | (The pure code use the debug code that perform incremental update, the C code reencode from scratch) | |
217 |
|
217 | |||
218 | #if pure |
|
218 | #if pure | |
219 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
219 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
220 | .hg/store/00changelog-????????????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob) |
|
220 | .hg/store/00changelog-????????????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob) | |
221 | #endif |
|
221 | #endif | |
222 |
|
222 | |||
223 | #if rust |
|
223 | #if rust | |
224 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
224 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
225 | .hg/store/00changelog-????????????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob) |
|
225 | .hg/store/00changelog-????????????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob) | |
226 | #endif |
|
226 | #endif | |
227 |
|
227 | |||
228 | #if no-pure no-rust |
|
228 | #if no-pure no-rust | |
229 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
229 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
230 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob) |
|
230 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob) | |
231 | #endif |
|
231 | #endif | |
232 |
|
232 | |||
233 | $ hg debugnodemap --check |
|
233 | $ hg debugnodemap --check | |
234 | revision in index: 5002 |
|
234 | revision in index: 5002 | |
235 | revision in nodemap: 5002 |
|
235 | revision in nodemap: 5002 | |
236 |
|
236 | |||
237 | Test code path without mmap |
|
237 | Test code path without mmap | |
238 | --------------------------- |
|
238 | --------------------------- | |
239 |
|
239 | |||
240 | $ echo bar > bar |
|
240 | $ echo bar > bar | |
241 | $ hg add bar |
|
241 | $ hg add bar | |
242 | $ hg ci -m 'bar' --config storage.revlog.persistent-nodemap.mmap=no |
|
242 | $ hg ci -m 'bar' --config storage.revlog.persistent-nodemap.mmap=no | |
243 |
|
243 | |||
244 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=yes |
|
244 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=yes | |
245 | revision in index: 5003 |
|
245 | revision in index: 5003 | |
246 | revision in nodemap: 5003 |
|
246 | revision in nodemap: 5003 | |
247 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=no |
|
247 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=no | |
248 | revision in index: 5003 |
|
248 | revision in index: 5003 | |
249 | revision in nodemap: 5003 |
|
249 | revision in nodemap: 5003 | |
250 |
|
250 | |||
251 |
|
251 | |||
252 | #if pure |
|
252 | #if pure | |
253 | $ hg debugnodemap --metadata |
|
253 | $ hg debugnodemap --metadata | |
254 | uid: ???????????????? (glob) |
|
254 | uid: ???????????????? (glob) | |
255 | tip-rev: 5002 |
|
255 | tip-rev: 5002 | |
256 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
256 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
257 | data-length: 121600 |
|
257 | data-length: 121600 | |
258 | data-unused: 512 |
|
258 | data-unused: 512 | |
259 | data-unused: 0.421% |
|
259 | data-unused: 0.421% | |
260 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
260 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
261 | .hg/store/00changelog-????????????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob) |
|
261 | .hg/store/00changelog-????????????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob) | |
262 | #endif |
|
262 | #endif | |
263 | #if rust |
|
263 | #if rust | |
264 | $ hg debugnodemap --metadata |
|
264 | $ hg debugnodemap --metadata | |
265 | uid: ???????????????? (glob) |
|
265 | uid: ???????????????? (glob) | |
266 | tip-rev: 5002 |
|
266 | tip-rev: 5002 | |
267 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
267 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
268 | data-length: 121600 |
|
268 | data-length: 121600 | |
269 | data-unused: 512 |
|
269 | data-unused: 512 | |
270 | data-unused: 0.421% |
|
270 | data-unused: 0.421% | |
271 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
271 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
272 | .hg/store/00changelog-????????????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob) |
|
272 | .hg/store/00changelog-????????????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob) | |
273 | #endif |
|
273 | #endif | |
274 | #if no-pure no-rust |
|
274 | #if no-pure no-rust | |
275 | $ hg debugnodemap --metadata |
|
275 | $ hg debugnodemap --metadata | |
276 | uid: ???????????????? (glob) |
|
276 | uid: ???????????????? (glob) | |
277 | tip-rev: 5002 |
|
277 | tip-rev: 5002 | |
278 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
278 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
279 | data-length: 121088 |
|
279 | data-length: 121088 | |
280 | data-unused: 0 |
|
280 | data-unused: 0 | |
281 | data-unused: 0.000% |
|
281 | data-unused: 0.000% | |
282 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
282 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
283 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob) |
|
283 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob) | |
284 | #endif |
|
284 | #endif | |
285 |
|
285 | |||
286 | Test force warming the cache |
|
286 | Test force warming the cache | |
287 |
|
287 | |||
288 | $ rm .hg/store/00changelog.n |
|
288 | $ rm .hg/store/00changelog.n | |
289 | $ hg debugnodemap --metadata |
|
289 | $ hg debugnodemap --metadata | |
290 | $ hg debugupdatecache |
|
290 | $ hg debugupdatecache | |
291 | #if pure |
|
291 | #if pure | |
292 | $ hg debugnodemap --metadata |
|
292 | $ hg debugnodemap --metadata | |
293 | uid: ???????????????? (glob) |
|
293 | uid: ???????????????? (glob) | |
294 | tip-rev: 5002 |
|
294 | tip-rev: 5002 | |
295 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
295 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
296 | data-length: 121088 |
|
296 | data-length: 121088 | |
297 | data-unused: 0 |
|
297 | data-unused: 0 | |
298 | data-unused: 0.000% |
|
298 | data-unused: 0.000% | |
299 | #else |
|
299 | #else | |
300 | $ hg debugnodemap --metadata |
|
300 | $ hg debugnodemap --metadata | |
301 | uid: ???????????????? (glob) |
|
301 | uid: ???????????????? (glob) | |
302 | tip-rev: 5002 |
|
302 | tip-rev: 5002 | |
303 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
303 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
304 | data-length: 121088 |
|
304 | data-length: 121088 | |
305 | data-unused: 0 |
|
305 | data-unused: 0 | |
306 | data-unused: 0.000% |
|
306 | data-unused: 0.000% | |
307 | #endif |
|
307 | #endif | |
308 |
|
308 | |||
309 | Check out of sync nodemap |
|
309 | Check out of sync nodemap | |
310 | ========================= |
|
310 | ========================= | |
311 |
|
311 | |||
312 | First copy old data on the side. |
|
312 | First copy old data on the side. | |
313 |
|
313 | |||
314 | $ mkdir ../tmp-copies |
|
314 | $ mkdir ../tmp-copies | |
315 | $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies |
|
315 | $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies | |
316 |
|
316 | |||
317 | Nodemap lagging behind |
|
317 | Nodemap lagging behind | |
318 | ---------------------- |
|
318 | ---------------------- | |
319 |
|
319 | |||
320 | make a new commit |
|
320 | make a new commit | |
321 |
|
321 | |||
322 | $ echo bar2 > bar |
|
322 | $ echo bar2 > bar | |
323 | $ hg ci -m 'bar2' |
|
323 | $ hg ci -m 'bar2' | |
324 | $ NODE=`hg log -r tip -T '{node}\n'` |
|
324 | $ NODE=`hg log -r tip -T '{node}\n'` | |
325 | $ hg log -r "$NODE" -T '{rev}\n' |
|
325 | $ hg log -r "$NODE" -T '{rev}\n' | |
326 | 5003 |
|
326 | 5003 | |
327 |
|
327 | |||
328 | If the nodemap is lagging behind, it can catch up fine |
|
328 | If the nodemap is lagging behind, it can catch up fine | |
329 |
|
329 | |||
330 | $ hg debugnodemap --metadata |
|
330 | $ hg debugnodemap --metadata | |
331 | uid: ???????????????? (glob) |
|
331 | uid: ???????????????? (glob) | |
332 | tip-rev: 5003 |
|
332 | tip-rev: 5003 | |
333 | tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3 |
|
333 | tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3 | |
334 | data-length: 121344 (pure !) |
|
334 | data-length: 121344 (pure !) | |
335 | data-length: 121344 (rust !) |
|
335 | data-length: 121344 (rust !) | |
336 | data-length: 121152 (no-rust no-pure !) |
|
336 | data-length: 121152 (no-rust no-pure !) | |
337 | data-unused: 192 (pure !) |
|
337 | data-unused: 192 (pure !) | |
338 | data-unused: 192 (rust !) |
|
338 | data-unused: 192 (rust !) | |
339 | data-unused: 0 (no-rust no-pure !) |
|
339 | data-unused: 0 (no-rust no-pure !) | |
340 | data-unused: 0.158% (pure !) |
|
340 | data-unused: 0.158% (pure !) | |
341 | data-unused: 0.158% (rust !) |
|
341 | data-unused: 0.158% (rust !) | |
342 | data-unused: 0.000% (no-rust no-pure !) |
|
342 | data-unused: 0.000% (no-rust no-pure !) | |
343 | $ cp -f ../tmp-copies/* .hg/store/ |
|
343 | $ cp -f ../tmp-copies/* .hg/store/ | |
344 | $ hg debugnodemap --metadata |
|
344 | $ hg debugnodemap --metadata | |
345 | uid: ???????????????? (glob) |
|
345 | uid: ???????????????? (glob) | |
346 | tip-rev: 5002 |
|
346 | tip-rev: 5002 | |
347 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
347 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
348 | data-length: 121088 |
|
348 | data-length: 121088 | |
349 | data-unused: 0 |
|
349 | data-unused: 0 | |
350 | data-unused: 0.000% |
|
350 | data-unused: 0.000% | |
351 | $ hg log -r "$NODE" -T '{rev}\n' |
|
351 | $ hg log -r "$NODE" -T '{rev}\n' | |
352 | 5003 |
|
352 | 5003 | |
353 |
|
353 | |||
354 | changelog altered |
|
354 | changelog altered | |
355 | ----------------- |
|
355 | ----------------- | |
356 |
|
356 | |||
357 | If the nodemap is not gated behind a requirements, an unaware client can alter |
|
357 | If the nodemap is not gated behind a requirements, an unaware client can alter | |
358 | the repository so the revlog used to generate the nodemap is not longer |
|
358 | the repository so the revlog used to generate the nodemap is not longer | |
359 | compatible with the persistent nodemap. We need to detect that. |
|
359 | compatible with the persistent nodemap. We need to detect that. | |
360 |
|
360 | |||
361 | $ hg up "$NODE~5" |
|
361 | $ hg up "$NODE~5" | |
362 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
362 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved | |
363 | $ echo bar > babar |
|
363 | $ echo bar > babar | |
364 | $ hg add babar |
|
364 | $ hg add babar | |
365 | $ hg ci -m 'babar' |
|
365 | $ hg ci -m 'babar' | |
366 | created new head |
|
366 | created new head | |
367 | $ OTHERNODE=`hg log -r tip -T '{node}\n'` |
|
367 | $ OTHERNODE=`hg log -r tip -T '{node}\n'` | |
368 | $ hg log -r "$OTHERNODE" -T '{rev}\n' |
|
368 | $ hg log -r "$OTHERNODE" -T '{rev}\n' | |
369 | 5004 |
|
369 | 5004 | |
370 |
|
370 | |||
371 | $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup |
|
371 | $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup | |
372 |
|
372 | |||
373 | the nodemap should detect the changelog have been tampered with and recover. |
|
373 | the nodemap should detect the changelog have been tampered with and recover. | |
374 |
|
374 | |||
375 | $ hg debugnodemap --metadata |
|
375 | $ hg debugnodemap --metadata | |
376 | uid: ???????????????? (glob) |
|
376 | uid: ???????????????? (glob) | |
377 | tip-rev: 5002 |
|
377 | tip-rev: 5002 | |
378 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 |
|
378 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 | |
379 | data-length: 121536 (pure !) |
|
379 | data-length: 121536 (pure !) | |
380 | data-length: 121088 (rust !) |
|
380 | data-length: 121088 (rust !) | |
381 | data-length: 121088 (no-pure no-rust !) |
|
381 | data-length: 121088 (no-pure no-rust !) | |
382 | data-unused: 448 (pure !) |
|
382 | data-unused: 448 (pure !) | |
383 | data-unused: 0 (rust !) |
|
383 | data-unused: 0 (rust !) | |
384 | data-unused: 0 (no-pure no-rust !) |
|
384 | data-unused: 0 (no-pure no-rust !) | |
385 | data-unused: 0.000% (rust !) |
|
385 | data-unused: 0.000% (rust !) | |
386 | data-unused: 0.369% (pure !) |
|
386 | data-unused: 0.369% (pure !) | |
387 | data-unused: 0.000% (no-pure no-rust !) |
|
387 | data-unused: 0.000% (no-pure no-rust !) | |
388 |
|
388 | |||
389 | $ cp -f ../tmp-copies/* .hg/store/ |
|
389 | $ cp -f ../tmp-copies/* .hg/store/ | |
390 | $ hg debugnodemap --metadata |
|
390 | $ hg debugnodemap --metadata | |
391 | uid: ???????????????? (glob) |
|
391 | uid: ???????????????? (glob) | |
392 | tip-rev: 5002 |
|
392 | tip-rev: 5002 | |
393 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
393 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
394 | data-length: 121088 |
|
394 | data-length: 121088 | |
395 | data-unused: 0 |
|
395 | data-unused: 0 | |
396 | data-unused: 0.000% |
|
396 | data-unused: 0.000% | |
397 | $ hg log -r "$OTHERNODE" -T '{rev}\n' |
|
397 | $ hg log -r "$OTHERNODE" -T '{rev}\n' | |
398 | 5002 |
|
398 | 5002 | |
399 |
|
399 | |||
400 | missing data file |
|
400 | missing data file | |
401 | ----------------- |
|
401 | ----------------- | |
402 |
|
402 | |||
403 | $ UUID=`hg debugnodemap --metadata| grep 'uid:' | \ |
|
403 | $ UUID=`hg debugnodemap --metadata| grep 'uid:' | \ | |
404 | > sed 's/uid: //'` |
|
404 | > sed 's/uid: //'` | |
405 | $ FILE=.hg/store/00changelog-"${UUID}".nd |
|
405 | $ FILE=.hg/store/00changelog-"${UUID}".nd | |
406 | $ mv $FILE ../tmp-data-file |
|
406 | $ mv $FILE ../tmp-data-file | |
407 | $ cp .hg/store/00changelog.n ../tmp-docket |
|
407 | $ cp .hg/store/00changelog.n ../tmp-docket | |
408 |
|
408 | |||
409 | mercurial don't crash |
|
409 | mercurial don't crash | |
410 |
|
410 | |||
411 | $ hg log -r . |
|
411 | $ hg log -r . | |
412 | changeset: 5002:b355ef8adce0 |
|
412 | changeset: 5002:b355ef8adce0 | |
413 | tag: tip |
|
413 | tag: tip | |
414 | parent: 4998:d918ad6d18d3 |
|
414 | parent: 4998:d918ad6d18d3 | |
415 | user: test |
|
415 | user: test | |
416 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
416 | date: Thu Jan 01 00:00:00 1970 +0000 | |
417 | summary: babar |
|
417 | summary: babar | |
418 |
|
418 | |||
419 | $ hg debugnodemap --metadata |
|
419 | $ hg debugnodemap --metadata | |
420 |
|
420 | |||
421 | $ hg debugupdatecache |
|
421 | $ hg debugupdatecache | |
422 | $ hg debugnodemap --metadata |
|
422 | $ hg debugnodemap --metadata | |
423 | uid: * (glob) |
|
423 | uid: * (glob) | |
424 | tip-rev: 5002 |
|
424 | tip-rev: 5002 | |
425 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 |
|
425 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 | |
426 | data-length: 121088 |
|
426 | data-length: 121088 | |
427 | data-unused: 0 |
|
427 | data-unused: 0 | |
428 | data-unused: 0.000% |
|
428 | data-unused: 0.000% | |
429 | $ mv ../tmp-data-file $FILE |
|
429 | $ mv ../tmp-data-file $FILE | |
430 | $ mv ../tmp-docket .hg/store/00changelog.n |
|
430 | $ mv ../tmp-docket .hg/store/00changelog.n | |
431 |
|
431 | |||
432 | Check transaction related property |
|
432 | Check transaction related property | |
433 | ================================== |
|
433 | ================================== | |
434 |
|
434 | |||
435 | An up to date nodemap should be available to shell hooks, |
|
435 | An up to date nodemap should be available to shell hooks, | |
436 |
|
436 | |||
437 | $ echo dsljfl > a |
|
437 | $ echo dsljfl > a | |
438 | $ hg add a |
|
438 | $ hg add a | |
439 | $ hg ci -m a |
|
439 | $ hg ci -m a | |
440 | $ hg debugnodemap --metadata |
|
440 | $ hg debugnodemap --metadata | |
441 | uid: ???????????????? (glob) |
|
441 | uid: ???????????????? (glob) | |
442 | tip-rev: 5003 |
|
442 | tip-rev: 5003 | |
443 | tip-node: a52c5079765b5865d97b993b303a18740113bbb2 |
|
443 | tip-node: a52c5079765b5865d97b993b303a18740113bbb2 | |
444 | data-length: 121088 |
|
444 | data-length: 121088 | |
445 | data-unused: 0 |
|
445 | data-unused: 0 | |
446 | data-unused: 0.000% |
|
446 | data-unused: 0.000% | |
447 | $ echo babar2 > babar |
|
447 | $ echo babar2 > babar | |
448 | $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata" |
|
448 | $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata" | |
449 | uid: ???????????????? (glob) |
|
449 | uid: ???????????????? (glob) | |
450 | tip-rev: 5004 |
|
450 | tip-rev: 5004 | |
451 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
451 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 | |
452 | data-length: 121280 (pure !) |
|
452 | data-length: 121280 (pure !) | |
453 | data-length: 121280 (rust !) |
|
453 | data-length: 121280 (rust !) | |
454 | data-length: 121088 (no-pure no-rust !) |
|
454 | data-length: 121088 (no-pure no-rust !) | |
455 | data-unused: 192 (pure !) |
|
455 | data-unused: 192 (pure !) | |
456 | data-unused: 192 (rust !) |
|
456 | data-unused: 192 (rust !) | |
457 | data-unused: 0 (no-pure no-rust !) |
|
457 | data-unused: 0 (no-pure no-rust !) | |
458 | data-unused: 0.158% (pure !) |
|
458 | data-unused: 0.158% (pure !) | |
459 | data-unused: 0.158% (rust !) |
|
459 | data-unused: 0.158% (rust !) | |
460 | data-unused: 0.000% (no-pure no-rust !) |
|
460 | data-unused: 0.000% (no-pure no-rust !) | |
461 | $ hg debugnodemap --metadata |
|
461 | $ hg debugnodemap --metadata | |
462 | uid: ???????????????? (glob) |
|
462 | uid: ???????????????? (glob) | |
463 | tip-rev: 5004 |
|
463 | tip-rev: 5004 | |
464 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
464 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 | |
465 | data-length: 121280 (pure !) |
|
465 | data-length: 121280 (pure !) | |
466 | data-length: 121280 (rust !) |
|
466 | data-length: 121280 (rust !) | |
467 | data-length: 121088 (no-pure no-rust !) |
|
467 | data-length: 121088 (no-pure no-rust !) | |
468 | data-unused: 192 (pure !) |
|
468 | data-unused: 192 (pure !) | |
469 | data-unused: 192 (rust !) |
|
469 | data-unused: 192 (rust !) | |
470 | data-unused: 0 (no-pure no-rust !) |
|
470 | data-unused: 0 (no-pure no-rust !) | |
471 | data-unused: 0.158% (pure !) |
|
471 | data-unused: 0.158% (pure !) | |
472 | data-unused: 0.158% (rust !) |
|
472 | data-unused: 0.158% (rust !) | |
473 | data-unused: 0.000% (no-pure no-rust !) |
|
473 | data-unused: 0.000% (no-pure no-rust !) | |
474 |
|
474 | |||
475 | Another process does not see the pending nodemap content during run. |
|
475 | Another process does not see the pending nodemap content during run. | |
476 |
|
476 | |||
477 | $ PATH=$RUNTESTDIR/testlib/:$PATH |
|
477 | $ PATH=$RUNTESTDIR/testlib/:$PATH | |
478 | $ echo qpoasp > a |
|
478 | $ echo qpoasp > a | |
479 | $ hg ci -m a2 \ |
|
479 | $ hg ci -m a2 \ | |
480 | > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \ |
|
480 | > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \ | |
481 | > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 & |
|
481 | > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 & | |
482 |
|
482 | |||
483 | (read the repository while the commit transaction is pending) |
|
483 | (read the repository while the commit transaction is pending) | |
484 |
|
484 | |||
485 | $ wait-on-file 20 sync-txn-pending && \ |
|
485 | $ wait-on-file 20 sync-txn-pending && \ | |
486 | > hg debugnodemap --metadata && \ |
|
486 | > hg debugnodemap --metadata && \ | |
487 | > wait-on-file 20 sync-txn-close sync-repo-read |
|
487 | > wait-on-file 20 sync-txn-close sync-repo-read | |
488 | uid: ???????????????? (glob) |
|
488 | uid: ???????????????? (glob) | |
489 | tip-rev: 5004 |
|
489 | tip-rev: 5004 | |
490 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
490 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 | |
491 | data-length: 121280 (pure !) |
|
491 | data-length: 121280 (pure !) | |
492 | data-length: 121280 (rust !) |
|
492 | data-length: 121280 (rust !) | |
493 | data-length: 121088 (no-pure no-rust !) |
|
493 | data-length: 121088 (no-pure no-rust !) | |
494 | data-unused: 192 (pure !) |
|
494 | data-unused: 192 (pure !) | |
495 | data-unused: 192 (rust !) |
|
495 | data-unused: 192 (rust !) | |
496 | data-unused: 0 (no-pure no-rust !) |
|
496 | data-unused: 0 (no-pure no-rust !) | |
497 | data-unused: 0.158% (pure !) |
|
497 | data-unused: 0.158% (pure !) | |
498 | data-unused: 0.158% (rust !) |
|
498 | data-unused: 0.158% (rust !) | |
499 | data-unused: 0.000% (no-pure no-rust !) |
|
499 | data-unused: 0.000% (no-pure no-rust !) | |
500 | $ hg debugnodemap --metadata |
|
500 | $ hg debugnodemap --metadata | |
501 | uid: ???????????????? (glob) |
|
501 | uid: ???????????????? (glob) | |
502 | tip-rev: 5005 |
|
502 | tip-rev: 5005 | |
503 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
503 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
504 | data-length: 121536 (pure !) |
|
504 | data-length: 121536 (pure !) | |
505 | data-length: 121536 (rust !) |
|
505 | data-length: 121536 (rust !) | |
506 | data-length: 121088 (no-pure no-rust !) |
|
506 | data-length: 121088 (no-pure no-rust !) | |
507 | data-unused: 448 (pure !) |
|
507 | data-unused: 448 (pure !) | |
508 | data-unused: 448 (rust !) |
|
508 | data-unused: 448 (rust !) | |
509 | data-unused: 0 (no-pure no-rust !) |
|
509 | data-unused: 0 (no-pure no-rust !) | |
510 | data-unused: 0.369% (pure !) |
|
510 | data-unused: 0.369% (pure !) | |
511 | data-unused: 0.369% (rust !) |
|
511 | data-unused: 0.369% (rust !) | |
512 | data-unused: 0.000% (no-pure no-rust !) |
|
512 | data-unused: 0.000% (no-pure no-rust !) | |
513 |
|
513 | |||
514 | $ cat output.txt |
|
514 | $ cat output.txt | |
515 |
|
515 | |||
516 | Check that a failing transaction will properly revert the data |
|
516 | Check that a failing transaction will properly revert the data | |
517 |
|
517 | |||
518 | $ echo plakfe > a |
|
518 | $ echo plakfe > a | |
519 | $ f --size --sha256 .hg/store/00changelog-*.nd |
|
519 | $ f --size --sha256 .hg/store/00changelog-*.nd | |
520 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) |
|
520 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) | |
521 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) |
|
521 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) | |
522 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) |
|
522 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) | |
523 | $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py" |
|
523 | $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py" | |
524 | transaction abort! |
|
524 | transaction abort! | |
525 | rollback completed |
|
525 | rollback completed | |
526 | abort: This is a late abort |
|
526 | abort: This is a late abort | |
527 | [255] |
|
527 | [255] | |
528 | $ hg debugnodemap --metadata |
|
528 | $ hg debugnodemap --metadata | |
529 | uid: ???????????????? (glob) |
|
529 | uid: ???????????????? (glob) | |
530 | tip-rev: 5005 |
|
530 | tip-rev: 5005 | |
531 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
531 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
532 | data-length: 121536 (pure !) |
|
532 | data-length: 121536 (pure !) | |
533 | data-length: 121536 (rust !) |
|
533 | data-length: 121536 (rust !) | |
534 | data-length: 121088 (no-pure no-rust !) |
|
534 | data-length: 121088 (no-pure no-rust !) | |
535 | data-unused: 448 (pure !) |
|
535 | data-unused: 448 (pure !) | |
536 | data-unused: 448 (rust !) |
|
536 | data-unused: 448 (rust !) | |
537 | data-unused: 0 (no-pure no-rust !) |
|
537 | data-unused: 0 (no-pure no-rust !) | |
538 | data-unused: 0.369% (pure !) |
|
538 | data-unused: 0.369% (pure !) | |
539 | data-unused: 0.369% (rust !) |
|
539 | data-unused: 0.369% (rust !) | |
540 | data-unused: 0.000% (no-pure no-rust !) |
|
540 | data-unused: 0.000% (no-pure no-rust !) | |
541 | $ f --size --sha256 .hg/store/00changelog-*.nd |
|
541 | $ f --size --sha256 .hg/store/00changelog-*.nd | |
542 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) |
|
542 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) | |
543 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) |
|
543 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) | |
544 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) |
|
544 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) | |
545 |
|
545 | |||
546 | Check that removing content does not confuse the nodemap |
|
546 | Check that removing content does not confuse the nodemap | |
547 | -------------------------------------------------------- |
|
547 | -------------------------------------------------------- | |
548 |
|
548 | |||
549 | removing data with rollback |
|
549 | removing data with rollback | |
550 |
|
550 | |||
551 | $ echo aso > a |
|
551 | $ echo aso > a | |
552 | $ hg ci -m a4 |
|
552 | $ hg ci -m a4 | |
553 | $ hg rollback |
|
553 | $ hg rollback | |
554 | repository tip rolled back to revision 5005 (undo commit) |
|
554 | repository tip rolled back to revision 5005 (undo commit) | |
555 | working directory now based on revision 5005 |
|
555 | working directory now based on revision 5005 | |
556 | $ hg id -r . |
|
556 | $ hg id -r . | |
557 | 90d5d3ba2fc4 tip |
|
557 | 90d5d3ba2fc4 tip | |
558 |
|
558 | |||
559 | roming data with strip |
|
559 | roming data with strip | |
560 |
|
560 | |||
561 | $ echo aso > a |
|
561 | $ echo aso > a | |
562 | $ hg ci -m a4 |
|
562 | $ hg ci -m a4 | |
563 | $ hg --config extensions.strip= strip -r . --no-backup |
|
563 | $ hg --config extensions.strip= strip -r . --no-backup | |
564 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
564 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
565 | $ hg id -r . --traceback |
|
565 | $ hg id -r . --traceback | |
566 | 90d5d3ba2fc4 tip |
|
566 | 90d5d3ba2fc4 tip | |
567 |
|
567 | |||
568 | Test upgrade / downgrade |
|
568 | Test upgrade / downgrade | |
569 | ======================== |
|
569 | ======================== | |
570 |
|
570 | |||
571 | downgrading |
|
571 | downgrading | |
572 |
|
572 | |||
573 | $ cat << EOF >> .hg/hgrc |
|
573 | $ cat << EOF >> .hg/hgrc | |
574 | > [format] |
|
574 | > [format] | |
575 | > use-persistent-nodemap=no |
|
575 | > use-persistent-nodemap=no | |
576 | > EOF |
|
576 | > EOF | |
577 | $ hg debugformat -v |
|
577 | $ hg debugformat -v | |
578 | format-variant repo config default |
|
578 | format-variant repo config default | |
579 | fncache: yes yes yes |
|
579 | fncache: yes yes yes | |
580 | dotencode: yes yes yes |
|
580 | dotencode: yes yes yes | |
581 | generaldelta: yes yes yes |
|
581 | generaldelta: yes yes yes | |
582 | share-safe: no no no |
|
582 | share-safe: no no no | |
583 | sparserevlog: yes yes yes |
|
583 | sparserevlog: yes yes yes | |
584 | persistent-nodemap: yes no no |
|
584 | persistent-nodemap: yes no no | |
585 | copies-sdc: no no no |
|
585 | copies-sdc: no no no | |
586 | revlog-v2: no no no |
|
586 | revlog-v2: no no no | |
587 | plain-cl-delta: yes yes yes |
|
587 | plain-cl-delta: yes yes yes | |
588 | compression: zlib zlib zlib (no-zstd !) |
|
588 | compression: zlib zlib zlib (no-zstd !) | |
589 | compression: zstd zstd zstd (zstd !) |
|
589 | compression: zstd zstd zstd (zstd !) | |
590 | compression-level: default default default |
|
590 | compression-level: default default default | |
591 | $ hg debugupgraderepo --run --no-backup |
|
591 | $ hg debugupgraderepo --run --no-backup | |
592 | upgrade will perform the following actions: |
|
592 | upgrade will perform the following actions: | |
593 |
|
593 | |||
594 | requirements |
|
594 | requirements | |
595 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !) |
|
595 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !) | |
596 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !) |
|
596 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !) | |
597 | removed: persistent-nodemap |
|
597 | removed: persistent-nodemap | |
598 |
|
598 | |||
599 | processed revlogs: |
|
599 | processed revlogs: | |
600 | - all-filelogs |
|
600 | - all-filelogs | |
601 | - changelog |
|
601 | - changelog | |
602 | - manifest |
|
602 | - manifest | |
603 |
|
603 | |||
604 | beginning upgrade... |
|
604 | beginning upgrade... | |
605 | repository locked and read-only |
|
605 | repository locked and read-only | |
606 | creating temporary repository to stage upgraded data: $TESTTMP/test-repo/.hg/upgrade.* (glob) |
|
606 | creating temporary repository to stage upgraded data: $TESTTMP/test-repo/.hg/upgrade.* (glob) | |
607 | (it is safe to interrupt this process any time before data migration completes) |
|
607 | (it is safe to interrupt this process any time before data migration completes) | |
608 | downgrading repository to not use persistent nodemap feature |
|
608 | downgrading repository to not use persistent nodemap feature | |
609 | removing temporary repository $TESTTMP/test-repo/.hg/upgrade.* (glob) |
|
609 | removing temporary repository $TESTTMP/test-repo/.hg/upgrade.* (glob) | |
610 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
610 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
611 | 00changelog-*.nd (glob) |
|
611 | 00changelog-*.nd (glob) | |
612 | 00manifest-*.nd (glob) |
|
612 | 00manifest-*.nd (glob) | |
613 | undo.backup.00changelog.n |
|
613 | undo.backup.00changelog.n | |
614 | undo.backup.00manifest.n |
|
614 | undo.backup.00manifest.n | |
615 | $ hg debugnodemap --metadata |
|
615 | $ hg debugnodemap --metadata | |
616 |
|
616 | |||
617 |
|
617 | |||
618 | upgrading |
|
618 | upgrading | |
619 |
|
619 | |||
620 | $ cat << EOF >> .hg/hgrc |
|
620 | $ cat << EOF >> .hg/hgrc | |
621 | > [format] |
|
621 | > [format] | |
622 | > use-persistent-nodemap=yes |
|
622 | > use-persistent-nodemap=yes | |
623 | > EOF |
|
623 | > EOF | |
624 | $ hg debugformat -v |
|
624 | $ hg debugformat -v | |
625 | format-variant repo config default |
|
625 | format-variant repo config default | |
626 | fncache: yes yes yes |
|
626 | fncache: yes yes yes | |
627 | dotencode: yes yes yes |
|
627 | dotencode: yes yes yes | |
628 | generaldelta: yes yes yes |
|
628 | generaldelta: yes yes yes | |
629 | share-safe: no no no |
|
629 | share-safe: no no no | |
630 | sparserevlog: yes yes yes |
|
630 | sparserevlog: yes yes yes | |
631 | persistent-nodemap: no yes no |
|
631 | persistent-nodemap: no yes no | |
632 | copies-sdc: no no no |
|
632 | copies-sdc: no no no | |
633 | revlog-v2: no no no |
|
633 | revlog-v2: no no no | |
634 | plain-cl-delta: yes yes yes |
|
634 | plain-cl-delta: yes yes yes | |
635 | compression: zlib zlib zlib (no-zstd !) |
|
635 | compression: zlib zlib zlib (no-zstd !) | |
636 | compression: zstd zstd zstd (zstd !) |
|
636 | compression: zstd zstd zstd (zstd !) | |
637 | compression-level: default default default |
|
637 | compression-level: default default default | |
638 | $ hg debugupgraderepo --run --no-backup |
|
638 | $ hg debugupgraderepo --run --no-backup | |
639 | upgrade will perform the following actions: |
|
639 | upgrade will perform the following actions: | |
640 |
|
640 | |||
641 | requirements |
|
641 | requirements | |
642 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !) |
|
642 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !) | |
643 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !) |
|
643 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !) | |
644 | added: persistent-nodemap |
|
644 | added: persistent-nodemap | |
645 |
|
645 | |||
646 | persistent-nodemap |
|
646 | persistent-nodemap | |
647 | Speedup revision lookup by node id. |
|
647 | Speedup revision lookup by node id. | |
648 |
|
648 | |||
649 | processed revlogs: |
|
649 | processed revlogs: | |
650 | - all-filelogs |
|
650 | - all-filelogs | |
651 | - changelog |
|
651 | - changelog | |
652 | - manifest |
|
652 | - manifest | |
653 |
|
653 | |||
654 | beginning upgrade... |
|
654 | beginning upgrade... | |
655 | repository locked and read-only |
|
655 | repository locked and read-only | |
656 | creating temporary repository to stage upgraded data: $TESTTMP/test-repo/.hg/upgrade.* (glob) |
|
656 | creating temporary repository to stage upgraded data: $TESTTMP/test-repo/.hg/upgrade.* (glob) | |
657 | (it is safe to interrupt this process any time before data migration completes) |
|
657 | (it is safe to interrupt this process any time before data migration completes) | |
658 | upgrading repository to use persistent nodemap feature |
|
658 | upgrading repository to use persistent nodemap feature | |
659 | removing temporary repository $TESTTMP/test-repo/.hg/upgrade.* (glob) |
|
659 | removing temporary repository $TESTTMP/test-repo/.hg/upgrade.* (glob) | |
660 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
660 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
661 | 00changelog-*.nd (glob) |
|
661 | 00changelog-*.nd (glob) | |
662 | 00changelog.n |
|
662 | 00changelog.n | |
663 | 00manifest-*.nd (glob) |
|
663 | 00manifest-*.nd (glob) | |
664 | 00manifest.n |
|
664 | 00manifest.n | |
665 | undo.backup.00changelog.n |
|
665 | undo.backup.00changelog.n | |
666 | undo.backup.00manifest.n |
|
666 | undo.backup.00manifest.n | |
667 |
|
667 | |||
668 | $ hg debugnodemap --metadata |
|
668 | $ hg debugnodemap --metadata | |
669 | uid: * (glob) |
|
669 | uid: * (glob) | |
670 | tip-rev: 5005 |
|
670 | tip-rev: 5005 | |
671 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
671 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
672 | data-length: 121088 |
|
672 | data-length: 121088 | |
673 | data-unused: 0 |
|
673 | data-unused: 0 | |
674 | data-unused: 0.000% |
|
674 | data-unused: 0.000% | |
675 |
|
675 | |||
676 | Running unrelated upgrade |
|
676 | Running unrelated upgrade | |
677 |
|
677 | |||
678 | $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all |
|
678 | $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all | |
679 | upgrade will perform the following actions: |
|
679 | upgrade will perform the following actions: | |
680 |
|
680 | |||
681 | requirements |
|
681 | requirements | |
682 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (no-zstd !) |
|
682 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (no-zstd !) | |
683 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !) |
|
683 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !) | |
684 |
|
684 | |||
685 | optimisations: re-delta-all |
|
685 | optimisations: re-delta-all | |
686 |
|
686 | |||
687 | processed revlogs: |
|
687 | processed revlogs: | |
688 | - all-filelogs |
|
688 | - all-filelogs | |
689 | - changelog |
|
689 | - changelog | |
690 | - manifest |
|
690 | - manifest | |
691 |
|
691 | |||
692 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
692 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
693 | 00changelog-*.nd (glob) |
|
693 | 00changelog-*.nd (glob) | |
694 | 00changelog.n |
|
694 | 00changelog.n | |
695 | 00manifest-*.nd (glob) |
|
695 | 00manifest-*.nd (glob) | |
696 | 00manifest.n |
|
696 | 00manifest.n | |
697 |
|
697 | |||
698 | $ hg debugnodemap --metadata |
|
698 | $ hg debugnodemap --metadata | |
699 | uid: * (glob) |
|
699 | uid: * (glob) | |
700 | tip-rev: 5005 |
|
700 | tip-rev: 5005 | |
701 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
701 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
702 | data-length: 121088 |
|
702 | data-length: 121088 | |
703 | data-unused: 0 |
|
703 | data-unused: 0 | |
704 | data-unused: 0.000% |
|
704 | data-unused: 0.000% | |
705 |
|
705 | |||
706 | Persistent nodemap and local/streaming clone |
|
706 | Persistent nodemap and local/streaming clone | |
707 | ============================================ |
|
707 | ============================================ | |
708 |
|
708 | |||
709 | $ cd .. |
|
709 | $ cd .. | |
710 |
|
710 | |||
711 | standard clone |
|
711 | standard clone | |
712 | -------------- |
|
712 | -------------- | |
713 |
|
713 | |||
714 | The persistent nodemap should exist after a streaming clone |
|
714 | The persistent nodemap should exist after a streaming clone | |
715 |
|
715 | |||
716 | $ hg clone --pull --quiet -U test-repo standard-clone |
|
716 | $ hg clone --pull --quiet -U test-repo standard-clone | |
717 | $ ls -1 standard-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
717 | $ ls -1 standard-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
718 | 00changelog-*.nd (glob) |
|
718 | 00changelog-*.nd (glob) | |
719 | 00changelog.n |
|
719 | 00changelog.n | |
720 | 00manifest-*.nd (glob) |
|
720 | 00manifest-*.nd (glob) | |
721 | 00manifest.n |
|
721 | 00manifest.n | |
722 | $ hg -R standard-clone debugnodemap --metadata |
|
722 | $ hg -R standard-clone debugnodemap --metadata | |
723 | uid: * (glob) |
|
723 | uid: * (glob) | |
724 | tip-rev: 5005 |
|
724 | tip-rev: 5005 | |
725 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
725 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
726 | data-length: 121088 |
|
726 | data-length: 121088 | |
727 | data-unused: 0 |
|
727 | data-unused: 0 | |
728 | data-unused: 0.000% |
|
728 | data-unused: 0.000% | |
729 |
|
729 | |||
730 |
|
730 | |||
731 | local clone |
|
731 | local clone | |
732 | ------------ |
|
732 | ------------ | |
733 |
|
733 | |||
734 | The persistent nodemap should exist after a streaming clone |
|
734 | The persistent nodemap should exist after a streaming clone | |
735 |
|
735 | |||
736 | $ hg clone -U test-repo local-clone |
|
736 | $ hg clone -U test-repo local-clone | |
737 | $ ls -1 local-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
737 | $ ls -1 local-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
738 | 00changelog-*.nd (glob) |
|
738 | 00changelog-*.nd (glob) | |
739 | 00changelog.n |
|
739 | 00changelog.n | |
740 | 00manifest-*.nd (glob) |
|
740 | 00manifest-*.nd (glob) | |
741 | 00manifest.n |
|
741 | 00manifest.n | |
742 | $ hg -R local-clone debugnodemap --metadata |
|
742 | $ hg -R local-clone debugnodemap --metadata | |
743 | uid: * (glob) |
|
743 | uid: * (glob) | |
744 | tip-rev: 5005 |
|
744 | tip-rev: 5005 | |
745 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
745 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
746 | data-length: 121088 |
|
746 | data-length: 121088 | |
747 | data-unused: 0 |
|
747 | data-unused: 0 | |
748 | data-unused: 0.000% |
|
748 | data-unused: 0.000% | |
749 |
|
749 | |||
|
750 | Test various corruption case | |||
|
751 | ============================ | |||
|
752 | ||||
|
753 | Missing datafile | |||
|
754 | ---------------- | |||
|
755 | ||||
|
756 | Test behavior with a missing datafile | |||
|
757 | ||||
|
758 | $ hg clone --quiet --pull test-repo corruption-test-repo | |||
|
759 | $ ls -1 corruption-test-repo/.hg/store/00changelog* | |||
|
760 | corruption-test-repo/.hg/store/00changelog-*.nd (glob) | |||
|
761 | corruption-test-repo/.hg/store/00changelog.d | |||
|
762 | corruption-test-repo/.hg/store/00changelog.i | |||
|
763 | corruption-test-repo/.hg/store/00changelog.n | |||
|
764 | $ rm corruption-test-repo/.hg/store/00changelog*.nd | |||
|
765 | $ hg log -R corruption-test-repo -r . | |||
|
766 | changeset: 5005:90d5d3ba2fc4 | |||
|
767 | tag: tip | |||
|
768 | user: test | |||
|
769 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
770 | summary: a2 | |||
|
771 | ||||
|
772 | $ ls -1 corruption-test-repo/.hg/store/00changelog* | |||
|
773 | corruption-test-repo/.hg/store/00changelog.d | |||
|
774 | corruption-test-repo/.hg/store/00changelog.i | |||
|
775 | corruption-test-repo/.hg/store/00changelog.n | |||
|
776 | ||||
|
777 | Truncated data file | |||
|
778 | ------------------- | |||
|
779 | ||||
|
780 | Test behavior with a too short datafile | |||
|
781 | ||||
|
782 | rebuild the missing data | |||
|
783 | $ hg -R corruption-test-repo debugupdatecache | |||
|
784 | $ ls -1 corruption-test-repo/.hg/store/00changelog* | |||
|
785 | corruption-test-repo/.hg/store/00changelog-*.nd (glob) | |||
|
786 | corruption-test-repo/.hg/store/00changelog.d | |||
|
787 | corruption-test-repo/.hg/store/00changelog.i | |||
|
788 | corruption-test-repo/.hg/store/00changelog.n | |||
|
789 | ||||
|
790 | truncate the file | |||
|
791 | ||||
|
792 | $ datafilepath=`ls corruption-test-repo/.hg/store/00changelog*.nd` | |||
|
793 | $ f -s $datafilepath | |||
|
794 | corruption-test-repo/.hg/store/00changelog-*.nd: size=121088 (glob) | |||
|
795 | $ dd if=$datafilepath bs=1000 count=10 of=$datafilepath-tmp status=none | |||
|
796 | $ mv $datafilepath-tmp $datafilepath | |||
|
797 | $ f -s $datafilepath | |||
|
798 | corruption-test-repo/.hg/store/00changelog-*.nd: size=10000 (glob) | |||
|
799 | ||||
|
800 | Check that Mercurial reaction to this event | |||
|
801 | ||||
|
802 | $ hg -R corruption-test-repo log -r . | |||
|
803 | abort: index 00changelog.i is corrupted | |||
|
804 | [50] | |||
|
805 | ||||
|
806 | ||||
750 | stream clone |
|
807 | stream clone | |
751 | ------------ |
|
808 | ------------ | |
752 |
|
809 | |||
753 | The persistent nodemap should exist after a streaming clone |
|
810 | The persistent nodemap should exist after a streaming clone | |
754 |
|
811 | |||
755 | $ hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone --debug | egrep '00(changelog|manifest)' |
|
812 | $ hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone --debug | egrep '00(changelog|manifest)' | |
756 | adding [s] 00manifest.n (70 bytes) |
|
813 | adding [s] 00manifest.n (70 bytes) | |
757 | adding [s] 00manifest.d (452 KB) (no-zstd !) |
|
814 | adding [s] 00manifest.d (452 KB) (no-zstd !) | |
758 | adding [s] 00manifest.d (491 KB) (zstd !) |
|
815 | adding [s] 00manifest.d (491 KB) (zstd !) | |
759 | adding [s] 00manifest-*.nd (118 KB) (glob) |
|
816 | adding [s] 00manifest-*.nd (118 KB) (glob) | |
760 | adding [s] 00changelog.n (70 bytes) |
|
817 | adding [s] 00changelog.n (70 bytes) | |
761 | adding [s] 00changelog.d (360 KB) (no-zstd !) |
|
818 | adding [s] 00changelog.d (360 KB) (no-zstd !) | |
762 | adding [s] 00changelog.d (368 KB) (zstd !) |
|
819 | adding [s] 00changelog.d (368 KB) (zstd !) | |
763 | adding [s] 00changelog-*.nd (118 KB) (glob) |
|
820 | adding [s] 00changelog-*.nd (118 KB) (glob) | |
764 | adding [s] 00manifest.i (313 KB) |
|
821 | adding [s] 00manifest.i (313 KB) | |
765 | adding [s] 00changelog.i (313 KB) |
|
822 | adding [s] 00changelog.i (313 KB) | |
766 | $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
823 | $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
767 | 00changelog-*.nd (glob) |
|
824 | 00changelog-*.nd (glob) | |
768 | 00changelog.n |
|
825 | 00changelog.n | |
769 | 00manifest-*.nd (glob) |
|
826 | 00manifest-*.nd (glob) | |
770 | 00manifest.n |
|
827 | 00manifest.n | |
771 | $ hg -R stream-clone debugnodemap --metadata |
|
828 | $ hg -R stream-clone debugnodemap --metadata | |
772 | uid: * (glob) |
|
829 | uid: * (glob) | |
773 | tip-rev: 5005 |
|
830 | tip-rev: 5005 | |
774 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
831 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
775 | data-length: 121088 |
|
832 | data-length: 121088 | |
776 | data-unused: 0 |
|
833 | data-unused: 0 | |
777 | data-unused: 0.000% |
|
834 | data-unused: 0.000% |
General Comments 0
You need to be logged in to leave comments.
Login now