Show More
@@ -1,577 +1,602 b'' | |||
|
1 | 1 | =================================== |
|
2 | 2 | Test the persistent on-disk nodemap |
|
3 | 3 | =================================== |
|
4 | 4 | |
|
5 | 5 | $ cat << EOF >> $HGRCPATH |
|
6 | 6 | > [format] |
|
7 | 7 | > use-persistent-nodemap=yes |
|
8 | 8 | > [devel] |
|
9 | 9 | > persistent-nodemap=yes |
|
10 | 10 | > EOF |
|
11 | 11 | $ hg init test-repo |
|
12 | 12 | $ cd test-repo |
|
13 | 13 | $ hg debugformat |
|
14 | 14 | format-variant repo |
|
15 | 15 | fncache: yes |
|
16 | 16 | dotencode: yes |
|
17 | 17 | generaldelta: yes |
|
18 | 18 | exp-sharesafe: no |
|
19 | 19 | sparserevlog: yes |
|
20 | 20 | sidedata: no |
|
21 | 21 | persistent-nodemap: yes |
|
22 | 22 | copies-sdc: no |
|
23 | 23 | plain-cl-delta: yes |
|
24 | 24 | compression: zlib |
|
25 | 25 | compression-level: default |
|
26 | 26 | $ hg debugbuilddag .+5000 --new-file --config "storage.revlog.nodemap.mode=warn" |
|
27 | 27 | persistent nodemap in strict mode without efficient method (no-rust no-pure !) |
|
28 | 28 | persistent nodemap in strict mode without efficient method (no-rust no-pure !) |
|
29 | 29 | $ hg debugnodemap --metadata |
|
30 | 30 | uid: ???????????????? (glob) |
|
31 | 31 | tip-rev: 5000 |
|
32 | 32 | tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c |
|
33 | 33 | data-length: 121088 |
|
34 | 34 | data-unused: 0 |
|
35 | 35 | data-unused: 0.000% |
|
36 | 36 | $ f --size .hg/store/00changelog.n |
|
37 | 37 | .hg/store/00changelog.n: size=70 |
|
38 | 38 | |
|
39 | 39 | Simple lookup works |
|
40 | 40 | |
|
41 | 41 | $ ANYNODE=`hg log --template '{node|short}\n' --rev tip` |
|
42 | 42 | $ hg log -r "$ANYNODE" --template '{rev}\n' |
|
43 | 43 | 5000 |
|
44 | 44 | |
|
45 | 45 | |
|
46 | 46 | #if rust |
|
47 | 47 | |
|
48 | 48 | $ f --sha256 .hg/store/00changelog-*.nd |
|
49 | 49 | .hg/store/00changelog-????????????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob) |
|
50 | 50 | |
|
51 | 51 | $ f --sha256 .hg/store/00manifest-*.nd |
|
52 | 52 | .hg/store/00manifest-????????????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob) |
|
53 | 53 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
54 | 54 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd |
|
55 | 55 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size |
|
56 | 56 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd |
|
57 | 57 | 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........| |
|
58 | 58 | 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."| |
|
59 | 59 | 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^| |
|
60 | 60 | 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....| |
|
61 | 61 | 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8| |
|
62 | 62 | 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i| |
|
63 | 63 | 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....| |
|
64 | 64 | 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........| |
|
65 | 65 | 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....| |
|
66 | 66 | 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................| |
|
67 | 67 | 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+| |
|
68 | 68 | 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................| |
|
69 | 69 | 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5| |
|
70 | 70 | 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U| |
|
71 | 71 | 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................| |
|
72 | 72 | 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................| |
|
73 | 73 | |
|
74 | 74 | |
|
75 | 75 | #else |
|
76 | 76 | |
|
77 | 77 | $ f --sha256 .hg/store/00changelog-*.nd |
|
78 | 78 | .hg/store/00changelog-????????????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob) |
|
79 | 79 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
80 | 80 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 |
|
81 | 81 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size |
|
82 | 82 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 |
|
83 | 83 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
84 | 84 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
85 | 85 | 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................| |
|
86 | 86 | 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
87 | 87 | 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
88 | 88 | 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................| |
|
89 | 89 | 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............| |
|
90 | 90 | 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
91 | 91 | 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
92 | 92 | 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................| |
|
93 | 93 | 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........| |
|
94 | 94 | 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
95 | 95 | 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
96 | 96 | 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
97 | 97 | 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................| |
|
98 | 98 | 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................| |
|
99 | 99 | |
|
100 | 100 | #endif |
|
101 | 101 | |
|
102 | 102 | $ hg debugnodemap --check |
|
103 | 103 | revision in index: 5001 |
|
104 | 104 | revision in nodemap: 5001 |
|
105 | 105 | |
|
106 | 106 | add a new commit |
|
107 | 107 | |
|
108 | 108 | $ hg up |
|
109 | 109 | 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
110 | 110 | $ echo foo > foo |
|
111 | 111 | $ hg add foo |
|
112 | 112 | |
|
113 | 113 | #if no-pure no-rust |
|
114 | 114 | |
|
115 | 115 | $ hg ci -m 'foo' --config "storage.revlog.nodemap.mode=strict" |
|
116 | 116 | transaction abort! |
|
117 | 117 | rollback completed |
|
118 | 118 | abort: persistent nodemap in strict mode without efficient method |
|
119 | 119 | [255] |
|
120 | 120 | |
|
121 | 121 | #endif |
|
122 | 122 | |
|
123 | 123 | $ hg ci -m 'foo' |
|
124 | 124 | |
|
125 | 125 | #if no-pure no-rust |
|
126 | 126 | $ hg debugnodemap --metadata |
|
127 | 127 | uid: ???????????????? (glob) |
|
128 | 128 | tip-rev: 5001 |
|
129 | 129 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c |
|
130 | 130 | data-length: 121088 |
|
131 | 131 | data-unused: 0 |
|
132 | 132 | data-unused: 0.000% |
|
133 | 133 | #else |
|
134 | 134 | $ hg debugnodemap --metadata |
|
135 | 135 | uid: ???????????????? (glob) |
|
136 | 136 | tip-rev: 5001 |
|
137 | 137 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c |
|
138 | 138 | data-length: 121344 |
|
139 | 139 | data-unused: 256 |
|
140 | 140 | data-unused: 0.211% |
|
141 | 141 | #endif |
|
142 | 142 | |
|
143 | 143 | $ f --size .hg/store/00changelog.n |
|
144 | 144 | .hg/store/00changelog.n: size=70 |
|
145 | 145 | |
|
146 | 146 | (The pure code use the debug code that perform incremental update, the C code reencode from scratch) |
|
147 | 147 | |
|
148 | 148 | #if pure |
|
149 | 149 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
150 | 150 | .hg/store/00changelog-????????????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob) |
|
151 | 151 | #endif |
|
152 | 152 | |
|
153 | 153 | #if rust |
|
154 | 154 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
155 | 155 | .hg/store/00changelog-????????????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob) |
|
156 | 156 | #endif |
|
157 | 157 | |
|
158 | 158 | #if no-pure no-rust |
|
159 | 159 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
160 | 160 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob) |
|
161 | 161 | #endif |
|
162 | 162 | |
|
163 | 163 | $ hg debugnodemap --check |
|
164 | 164 | revision in index: 5002 |
|
165 | 165 | revision in nodemap: 5002 |
|
166 | 166 | |
|
167 | 167 | Test code path without mmap |
|
168 | 168 | --------------------------- |
|
169 | 169 | |
|
170 | 170 | $ echo bar > bar |
|
171 | 171 | $ hg add bar |
|
172 | 172 | $ hg ci -m 'bar' --config storage.revlog.nodemap.mmap=no |
|
173 | 173 | |
|
174 | 174 | $ hg debugnodemap --check --config storage.revlog.nodemap.mmap=yes |
|
175 | 175 | revision in index: 5003 |
|
176 | 176 | revision in nodemap: 5003 |
|
177 | 177 | $ hg debugnodemap --check --config storage.revlog.nodemap.mmap=no |
|
178 | 178 | revision in index: 5003 |
|
179 | 179 | revision in nodemap: 5003 |
|
180 | 180 | |
|
181 | 181 | |
|
182 | 182 | #if pure |
|
183 | 183 | $ hg debugnodemap --metadata |
|
184 | 184 | uid: ???????????????? (glob) |
|
185 | 185 | tip-rev: 5002 |
|
186 | 186 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
187 | 187 | data-length: 121600 |
|
188 | 188 | data-unused: 512 |
|
189 | 189 | data-unused: 0.421% |
|
190 | 190 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
191 | 191 | .hg/store/00changelog-????????????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob) |
|
192 | 192 | #endif |
|
193 | 193 | #if rust |
|
194 | 194 | $ hg debugnodemap --metadata |
|
195 | 195 | uid: ???????????????? (glob) |
|
196 | 196 | tip-rev: 5002 |
|
197 | 197 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
198 | 198 | data-length: 121600 |
|
199 | 199 | data-unused: 512 |
|
200 | 200 | data-unused: 0.421% |
|
201 | 201 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
202 | 202 | .hg/store/00changelog-????????????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob) |
|
203 | 203 | #endif |
|
204 | 204 | #if no-pure no-rust |
|
205 | 205 | $ hg debugnodemap --metadata |
|
206 | 206 | uid: ???????????????? (glob) |
|
207 | 207 | tip-rev: 5002 |
|
208 | 208 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
209 | 209 | data-length: 121088 |
|
210 | 210 | data-unused: 0 |
|
211 | 211 | data-unused: 0.000% |
|
212 | 212 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
213 | 213 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob) |
|
214 | 214 | #endif |
|
215 | 215 | |
|
216 | 216 | Test force warming the cache |
|
217 | 217 | |
|
218 | 218 | $ rm .hg/store/00changelog.n |
|
219 | 219 | $ hg debugnodemap --metadata |
|
220 | 220 | $ hg debugupdatecache |
|
221 | 221 | #if pure |
|
222 | 222 | $ hg debugnodemap --metadata |
|
223 | 223 | uid: ???????????????? (glob) |
|
224 | 224 | tip-rev: 5002 |
|
225 | 225 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
226 | 226 | data-length: 121088 |
|
227 | 227 | data-unused: 0 |
|
228 | 228 | data-unused: 0.000% |
|
229 | 229 | #else |
|
230 | 230 | $ hg debugnodemap --metadata |
|
231 | 231 | uid: ???????????????? (glob) |
|
232 | 232 | tip-rev: 5002 |
|
233 | 233 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
234 | 234 | data-length: 121088 |
|
235 | 235 | data-unused: 0 |
|
236 | 236 | data-unused: 0.000% |
|
237 | 237 | #endif |
|
238 | 238 | |
|
239 | 239 | Check out of sync nodemap |
|
240 | 240 | ========================= |
|
241 | 241 | |
|
242 | 242 | First copy old data on the side. |
|
243 | 243 | |
|
244 | 244 | $ mkdir ../tmp-copies |
|
245 | 245 | $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies |
|
246 | 246 | |
|
247 | 247 | Nodemap lagging behind |
|
248 | 248 | ---------------------- |
|
249 | 249 | |
|
250 | 250 | make a new commit |
|
251 | 251 | |
|
252 | 252 | $ echo bar2 > bar |
|
253 | 253 | $ hg ci -m 'bar2' |
|
254 | 254 | $ NODE=`hg log -r tip -T '{node}\n'` |
|
255 | 255 | $ hg log -r "$NODE" -T '{rev}\n' |
|
256 | 256 | 5003 |
|
257 | 257 | |
|
258 | 258 | If the nodemap is lagging behind, it can catch up fine |
|
259 | 259 | |
|
260 | 260 | $ hg debugnodemap --metadata |
|
261 | 261 | uid: ???????????????? (glob) |
|
262 | 262 | tip-rev: 5003 |
|
263 | 263 | tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3 |
|
264 | 264 | data-length: 121344 (pure !) |
|
265 | 265 | data-length: 121344 (rust !) |
|
266 | 266 | data-length: 121152 (no-rust no-pure !) |
|
267 | 267 | data-unused: 192 (pure !) |
|
268 | 268 | data-unused: 192 (rust !) |
|
269 | 269 | data-unused: 0 (no-rust no-pure !) |
|
270 | 270 | data-unused: 0.158% (pure !) |
|
271 | 271 | data-unused: 0.158% (rust !) |
|
272 | 272 | data-unused: 0.000% (no-rust no-pure !) |
|
273 | 273 | $ cp -f ../tmp-copies/* .hg/store/ |
|
274 | 274 | $ hg debugnodemap --metadata |
|
275 | 275 | uid: ???????????????? (glob) |
|
276 | 276 | tip-rev: 5002 |
|
277 | 277 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
278 | 278 | data-length: 121088 |
|
279 | 279 | data-unused: 0 |
|
280 | 280 | data-unused: 0.000% |
|
281 | 281 | $ hg log -r "$NODE" -T '{rev}\n' |
|
282 | 282 | 5003 |
|
283 | 283 | |
|
284 | 284 | changelog altered |
|
285 | 285 | ----------------- |
|
286 | 286 | |
|
287 | 287 | If the nodemap is not gated behind a requirements, an unaware client can alter |
|
288 | 288 | the repository so the revlog used to generate the nodemap is not longer |
|
289 | 289 | compatible with the persistent nodemap. We need to detect that. |
|
290 | 290 | |
|
291 | 291 | $ hg up "$NODE~5" |
|
292 | 292 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
293 | 293 | $ echo bar > babar |
|
294 | 294 | $ hg add babar |
|
295 | 295 | $ hg ci -m 'babar' |
|
296 | 296 | created new head |
|
297 | 297 | $ OTHERNODE=`hg log -r tip -T '{node}\n'` |
|
298 | 298 | $ hg log -r "$OTHERNODE" -T '{rev}\n' |
|
299 | 299 | 5004 |
|
300 | 300 | |
|
301 | 301 | $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup |
|
302 | 302 | |
|
303 | 303 | the nodemap should detect the changelog have been tampered with and recover. |
|
304 | 304 | |
|
305 | 305 | $ hg debugnodemap --metadata |
|
306 | 306 | uid: ???????????????? (glob) |
|
307 | 307 | tip-rev: 5002 |
|
308 | 308 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 |
|
309 | 309 | data-length: 121536 (pure !) |
|
310 | 310 | data-length: 121088 (rust !) |
|
311 | 311 | data-length: 121088 (no-pure no-rust !) |
|
312 | 312 | data-unused: 448 (pure !) |
|
313 | 313 | data-unused: 0 (rust !) |
|
314 | 314 | data-unused: 0 (no-pure no-rust !) |
|
315 | 315 | data-unused: 0.000% (rust !) |
|
316 | 316 | data-unused: 0.369% (pure !) |
|
317 | 317 | data-unused: 0.000% (no-pure no-rust !) |
|
318 | 318 | |
|
319 | 319 | $ cp -f ../tmp-copies/* .hg/store/ |
|
320 | 320 | $ hg debugnodemap --metadata |
|
321 | 321 | uid: ???????????????? (glob) |
|
322 | 322 | tip-rev: 5002 |
|
323 | 323 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
324 | 324 | data-length: 121088 |
|
325 | 325 | data-unused: 0 |
|
326 | 326 | data-unused: 0.000% |
|
327 | 327 | $ hg log -r "$OTHERNODE" -T '{rev}\n' |
|
328 | 328 | 5002 |
|
329 | 329 | |
|
330 | 330 | Check transaction related property |
|
331 | 331 | ================================== |
|
332 | 332 | |
|
333 | 333 | An up to date nodemap should be available to shell hooks, |
|
334 | 334 | |
|
335 | 335 | $ echo dsljfl > a |
|
336 | 336 | $ hg add a |
|
337 | 337 | $ hg ci -m a |
|
338 | 338 | $ hg debugnodemap --metadata |
|
339 | 339 | uid: ???????????????? (glob) |
|
340 | 340 | tip-rev: 5003 |
|
341 | 341 | tip-node: a52c5079765b5865d97b993b303a18740113bbb2 |
|
342 | 342 | data-length: 121088 |
|
343 | 343 | data-unused: 0 |
|
344 | 344 | data-unused: 0.000% |
|
345 | 345 | $ echo babar2 > babar |
|
346 | 346 | $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata" |
|
347 | 347 | uid: ???????????????? (glob) |
|
348 | 348 | tip-rev: 5004 |
|
349 | 349 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
350 | 350 | data-length: 121280 (pure !) |
|
351 | 351 | data-length: 121280 (rust !) |
|
352 | 352 | data-length: 121088 (no-pure no-rust !) |
|
353 | 353 | data-unused: 192 (pure !) |
|
354 | 354 | data-unused: 192 (rust !) |
|
355 | 355 | data-unused: 0 (no-pure no-rust !) |
|
356 | 356 | data-unused: 0.158% (pure !) |
|
357 | 357 | data-unused: 0.158% (rust !) |
|
358 | 358 | data-unused: 0.000% (no-pure no-rust !) |
|
359 | 359 | $ hg debugnodemap --metadata |
|
360 | 360 | uid: ???????????????? (glob) |
|
361 | 361 | tip-rev: 5004 |
|
362 | 362 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
363 | 363 | data-length: 121280 (pure !) |
|
364 | 364 | data-length: 121280 (rust !) |
|
365 | 365 | data-length: 121088 (no-pure no-rust !) |
|
366 | 366 | data-unused: 192 (pure !) |
|
367 | 367 | data-unused: 192 (rust !) |
|
368 | 368 | data-unused: 0 (no-pure no-rust !) |
|
369 | 369 | data-unused: 0.158% (pure !) |
|
370 | 370 | data-unused: 0.158% (rust !) |
|
371 | 371 | data-unused: 0.000% (no-pure no-rust !) |
|
372 | 372 | |
|
373 | 373 | Another process does not see the pending nodemap content during run. |
|
374 | 374 | |
|
375 | 375 | $ PATH=$RUNTESTDIR/testlib/:$PATH |
|
376 | 376 | $ echo qpoasp > a |
|
377 | 377 | $ hg ci -m a2 \ |
|
378 | 378 | > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \ |
|
379 | 379 | > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 & |
|
380 | 380 | |
|
381 | 381 | (read the repository while the commit transaction is pending) |
|
382 | 382 | |
|
383 | 383 | $ wait-on-file 20 sync-txn-pending && \ |
|
384 | 384 | > hg debugnodemap --metadata && \ |
|
385 | 385 | > wait-on-file 20 sync-txn-close sync-repo-read |
|
386 | 386 | uid: ???????????????? (glob) |
|
387 | 387 | tip-rev: 5004 |
|
388 | 388 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
389 | 389 | data-length: 121280 (pure !) |
|
390 | 390 | data-length: 121280 (rust !) |
|
391 | 391 | data-length: 121088 (no-pure no-rust !) |
|
392 | 392 | data-unused: 192 (pure !) |
|
393 | 393 | data-unused: 192 (rust !) |
|
394 | 394 | data-unused: 0 (no-pure no-rust !) |
|
395 | 395 | data-unused: 0.158% (pure !) |
|
396 | 396 | data-unused: 0.158% (rust !) |
|
397 | 397 | data-unused: 0.000% (no-pure no-rust !) |
|
398 | 398 | $ hg debugnodemap --metadata |
|
399 | 399 | uid: ???????????????? (glob) |
|
400 | 400 | tip-rev: 5005 |
|
401 | 401 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
402 | 402 | data-length: 121536 (pure !) |
|
403 | 403 | data-length: 121536 (rust !) |
|
404 | 404 | data-length: 121088 (no-pure no-rust !) |
|
405 | 405 | data-unused: 448 (pure !) |
|
406 | 406 | data-unused: 448 (rust !) |
|
407 | 407 | data-unused: 0 (no-pure no-rust !) |
|
408 | 408 | data-unused: 0.369% (pure !) |
|
409 | 409 | data-unused: 0.369% (rust !) |
|
410 | 410 | data-unused: 0.000% (no-pure no-rust !) |
|
411 | 411 | |
|
412 | 412 | $ cat output.txt |
|
413 | 413 | |
|
414 | 414 | Check that a failing transaction will properly revert the data |
|
415 | 415 | |
|
416 | 416 | $ echo plakfe > a |
|
417 | 417 | $ f --size --sha256 .hg/store/00changelog-*.nd |
|
418 | 418 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) |
|
419 | 419 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) |
|
420 | 420 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) |
|
421 | 421 | $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py" |
|
422 | 422 | transaction abort! |
|
423 | 423 | rollback completed |
|
424 | 424 | abort: This is a late abort |
|
425 | 425 | [255] |
|
426 | 426 | $ hg debugnodemap --metadata |
|
427 | 427 | uid: ???????????????? (glob) |
|
428 | 428 | tip-rev: 5005 |
|
429 | 429 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
430 | 430 | data-length: 121536 (pure !) |
|
431 | 431 | data-length: 121536 (rust !) |
|
432 | 432 | data-length: 121088 (no-pure no-rust !) |
|
433 | 433 | data-unused: 448 (pure !) |
|
434 | 434 | data-unused: 448 (rust !) |
|
435 | 435 | data-unused: 0 (no-pure no-rust !) |
|
436 | 436 | data-unused: 0.369% (pure !) |
|
437 | 437 | data-unused: 0.369% (rust !) |
|
438 | 438 | data-unused: 0.000% (no-pure no-rust !) |
|
439 | 439 | $ f --size --sha256 .hg/store/00changelog-*.nd |
|
440 | 440 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) |
|
441 | 441 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) |
|
442 | 442 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) |
|
443 | 443 | |
|
444 | 444 | Check that removing content does not confuse the nodemap |
|
445 | 445 | -------------------------------------------------------- |
|
446 | 446 | |
|
447 | 447 | removing data with rollback |
|
448 | 448 | |
|
449 | 449 | $ echo aso > a |
|
450 | 450 | $ hg ci -m a4 |
|
451 | 451 | $ hg rollback |
|
452 | 452 | repository tip rolled back to revision 5005 (undo commit) |
|
453 | 453 | working directory now based on revision 5005 |
|
454 | 454 | $ hg id -r . |
|
455 | 455 | 90d5d3ba2fc4 tip |
|
456 | 456 | |
|
457 | 457 | roming data with strip |
|
458 | 458 | |
|
459 | 459 | $ echo aso > a |
|
460 | 460 | $ hg ci -m a4 |
|
461 | 461 | $ hg --config extensions.strip= strip -r . --no-backup |
|
462 | 462 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
463 | 463 | $ hg id -r . --traceback |
|
464 | 464 | 90d5d3ba2fc4 tip |
|
465 | 465 | |
|
466 | 466 | Test upgrade / downgrade |
|
467 | 467 | ======================== |
|
468 | 468 | |
|
469 | 469 | downgrading |
|
470 | 470 | |
|
471 | 471 | $ cat << EOF >> .hg/hgrc |
|
472 | 472 | > [format] |
|
473 | 473 | > use-persistent-nodemap=no |
|
474 | 474 | > EOF |
|
475 | 475 | $ hg debugformat -v |
|
476 | 476 | format-variant repo config default |
|
477 | 477 | fncache: yes yes yes |
|
478 | 478 | dotencode: yes yes yes |
|
479 | 479 | generaldelta: yes yes yes |
|
480 | 480 | exp-sharesafe: no no no |
|
481 | 481 | sparserevlog: yes yes yes |
|
482 | 482 | sidedata: no no no |
|
483 | 483 | persistent-nodemap: yes no no |
|
484 | 484 | copies-sdc: no no no |
|
485 | 485 | plain-cl-delta: yes yes yes |
|
486 | 486 | compression: zlib zlib zlib |
|
487 | 487 | compression-level: default default default |
|
488 | 488 | $ hg debugupgraderepo --run --no-backup --quiet |
|
489 | 489 | upgrade will perform the following actions: |
|
490 | 490 | |
|
491 | 491 | requirements |
|
492 | 492 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store |
|
493 | 493 | removed: persistent-nodemap |
|
494 | 494 | |
|
495 | 495 | processed revlogs: |
|
496 | 496 | - all-filelogs |
|
497 | 497 | - changelog |
|
498 | 498 | - manifest |
|
499 | 499 | |
|
500 | 500 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
501 | 501 | [1] |
|
502 | 502 | $ hg debugnodemap --metadata |
|
503 | 503 | |
|
504 | 504 | |
|
505 | 505 | upgrading |
|
506 | 506 | |
|
507 | 507 | $ cat << EOF >> .hg/hgrc |
|
508 | 508 | > [format] |
|
509 | 509 | > use-persistent-nodemap=yes |
|
510 | 510 | > EOF |
|
511 | 511 | $ hg debugformat -v |
|
512 | 512 | format-variant repo config default |
|
513 | 513 | fncache: yes yes yes |
|
514 | 514 | dotencode: yes yes yes |
|
515 | 515 | generaldelta: yes yes yes |
|
516 | 516 | exp-sharesafe: no no no |
|
517 | 517 | sparserevlog: yes yes yes |
|
518 | 518 | sidedata: no no no |
|
519 | 519 | persistent-nodemap: no yes no |
|
520 | 520 | copies-sdc: no no no |
|
521 | 521 | plain-cl-delta: yes yes yes |
|
522 | 522 | compression: zlib zlib zlib |
|
523 | 523 | compression-level: default default default |
|
524 | 524 | $ hg debugupgraderepo --run --no-backup --quiet |
|
525 | 525 | upgrade will perform the following actions: |
|
526 | 526 | |
|
527 | 527 | requirements |
|
528 | 528 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store |
|
529 | 529 | added: persistent-nodemap |
|
530 | 530 | |
|
531 | 531 | processed revlogs: |
|
532 | 532 | - all-filelogs |
|
533 | 533 | - changelog |
|
534 | 534 | - manifest |
|
535 | 535 | |
|
536 | 536 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
537 | 537 | 00changelog-*.nd (glob) |
|
538 | 538 | 00changelog.n |
|
539 | 539 | 00manifest-*.nd (glob) |
|
540 | 540 | 00manifest.n |
|
541 | 541 | |
|
542 | 542 | $ hg debugnodemap --metadata |
|
543 | 543 | uid: * (glob) |
|
544 | 544 | tip-rev: 5005 |
|
545 | 545 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
546 | 546 | data-length: 121088 |
|
547 | 547 | data-unused: 0 |
|
548 | 548 | data-unused: 0.000% |
|
549 | 549 | |
|
550 | 550 | Running unrelated upgrade |
|
551 | 551 | |
|
552 | 552 | $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all |
|
553 | 553 | upgrade will perform the following actions: |
|
554 | 554 | |
|
555 | 555 | requirements |
|
556 | 556 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store |
|
557 | 557 | |
|
558 | 558 | optimisations: re-delta-all |
|
559 | 559 | |
|
560 | 560 | processed revlogs: |
|
561 | 561 | - all-filelogs |
|
562 | 562 | - changelog |
|
563 | 563 | - manifest |
|
564 | 564 | |
|
565 | 565 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
566 | 566 | 00changelog-*.nd (glob) |
|
567 | 567 | 00changelog.n |
|
568 | 568 | 00manifest-*.nd (glob) |
|
569 | 569 | 00manifest.n |
|
570 | 570 | |
|
571 | 571 | $ hg debugnodemap --metadata |
|
572 | 572 | uid: * (glob) |
|
573 | 573 | tip-rev: 5005 |
|
574 | 574 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
575 | 575 | data-length: 121088 |
|
576 | 576 | data-unused: 0 |
|
577 | 577 | data-unused: 0.000% |
|
578 | ||
|
579 | Persistent nodemap and local/streaming clone | |
|
580 | ============================================ | |
|
581 | ||
|
582 | $ cd .. | |
|
583 | ||
|
584 | standard clone | |
|
585 | -------------- | |
|
586 | ||
|
587 | The persistent nodemap should exist after a streaming clone | |
|
588 | ||
|
589 | $ hg clone --pull --quiet -U test-repo standard-clone | |
|
590 | $ ls -1 standard-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
|
591 | 00changelog-*.nd (glob) | |
|
592 | 00changelog.n | |
|
593 | 00manifest-*.nd (glob) | |
|
594 | 00manifest.n | |
|
595 | $ hg -R standard-clone debugnodemap --metadata | |
|
596 | uid: * (glob) | |
|
597 | tip-rev: 5005 | |
|
598 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
|
599 | data-length: 121088 | |
|
600 | data-unused: 0 | |
|
601 | data-unused: 0.000% | |
|
602 |
General Comments 0
You need to be logged in to leave comments.
Login now