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