comparison tests/test-verify.t @ 49826:c84844cd523a

verify: also check dirstate The dirstate already is capable of verifying its integrity (although v2 features are not yet checked), let's run that code in `hg verify`.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 02 May 2022 11:27:20 +0200
parents 2f2682f40ea0
children d09a57ce6fc4
comparison
equal deleted inserted replaced
49825:2f2682f40ea0 49826:c84844cd523a
18 $ hg verify 18 $ hg verify
19 checking changesets 19 checking changesets
20 checking manifests 20 checking manifests
21 crosschecking files in changesets and manifests 21 crosschecking files in changesets and manifests
22 checking files 22 checking files
23 checking dirstate
23 checked 1 changesets with 3 changes to 3 files 24 checked 1 changesets with 3 changes to 3 files
24 25
25 verify with journal 26 verify with journal
26 27
27 $ touch .hg/store/journal 28 $ touch .hg/store/journal
29 abandoned transaction found - run hg recover 30 abandoned transaction found - run hg recover
30 checking changesets 31 checking changesets
31 checking manifests 32 checking manifests
32 crosschecking files in changesets and manifests 33 crosschecking files in changesets and manifests
33 checking files 34 checking files
35 checking dirstate
34 checked 1 changesets with 3 changes to 3 files 36 checked 1 changesets with 3 changes to 3 files
35 $ rm .hg/store/journal 37 $ rm .hg/store/journal
36 38
37 introduce some bugs in repo 39 introduce some bugs in repo
38 40
53 0: empty or missing QUICK.txt 55 0: empty or missing QUICK.txt
54 QUICK.txt@0: manifest refers to unknown revision 88b857db8eba 56 QUICK.txt@0: manifest refers to unknown revision 88b857db8eba
55 warning: revlog 'data/bar.txt.i' not in fncache! 57 warning: revlog 'data/bar.txt.i' not in fncache!
56 0: empty or missing bar.txt 58 0: empty or missing bar.txt
57 bar.txt@0: manifest refers to unknown revision 256559129457 59 bar.txt@0: manifest refers to unknown revision 256559129457
60 not checking dirstate because of previous errors
58 checked 1 changesets with 0 changes to 3 files 61 checked 1 changesets with 0 changes to 3 files
59 3 warnings encountered! 62 3 warnings encountered!
60 hint: run "hg debugrebuildfncache" to recover from corrupt fncache 63 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
61 6 integrity errors encountered! 64 6 integrity errors encountered!
62 (first damaged changeset appears to be 0) 65 (first damaged changeset appears to be 0)
81 $ rm .hg/store/00changelog.* 84 $ rm .hg/store/00changelog.*
82 $ hg verify -q 85 $ hg verify -q
83 0: empty or missing changelog 86 0: empty or missing changelog
84 manifest@0: d0b6632564d4 not in changesets 87 manifest@0: d0b6632564d4 not in changesets
85 manifest@1: 941fc4534185 not in changesets 88 manifest@1: 941fc4534185 not in changesets
89 not checking dirstate because of previous errors
86 3 integrity errors encountered! 90 3 integrity errors encountered!
87 (first damaged changeset appears to be 0) 91 (first damaged changeset appears to be 0)
88 [1] 92 [1]
89 $ cp -R .hg/store-full/. .hg/store 93 $ cp -R .hg/store-full/. .hg/store
90 94
91 Entire manifest log missing 95 Entire manifest log missing
92 96
93 $ rm .hg/store/00manifest.* 97 $ rm .hg/store/00manifest.*
94 $ hg verify -q 98 $ hg verify -q
95 0: empty or missing manifest 99 0: empty or missing manifest
100 not checking dirstate because of previous errors
96 1 integrity errors encountered! 101 1 integrity errors encountered!
97 (first damaged changeset appears to be 0) 102 (first damaged changeset appears to be 0)
98 [1] 103 [1]
99 $ cp -R .hg/store-full/. .hg/store 104 $ cp -R .hg/store-full/. .hg/store
100 105
104 $ hg verify -q 109 $ hg verify -q
105 warning: revlog 'data/file.i' not in fncache! 110 warning: revlog 'data/file.i' not in fncache!
106 0: empty or missing file 111 0: empty or missing file
107 file@0: manifest refers to unknown revision 362fef284ce2 112 file@0: manifest refers to unknown revision 362fef284ce2
108 file@1: manifest refers to unknown revision c10f2164107d 113 file@1: manifest refers to unknown revision c10f2164107d
114 not checking dirstate because of previous errors
109 1 warnings encountered! 115 1 warnings encountered!
110 hint: run "hg debugrebuildfncache" to recover from corrupt fncache 116 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
111 3 integrity errors encountered! 117 3 integrity errors encountered!
112 (first damaged changeset appears to be 0) 118 (first damaged changeset appears to be 0)
113 [1] 119 [1]
117 123
118 $ rm .hg/store/00changelog.* 124 $ rm .hg/store/00changelog.*
119 $ rm .hg/store/00manifest.* 125 $ rm .hg/store/00manifest.*
120 $ hg verify -q 126 $ hg verify -q
121 warning: orphan data file 'data/file.i' 127 warning: orphan data file 'data/file.i'
122 1 warnings encountered! 128 warning: ignoring unknown working parent c5ddb05ab828!
129 file marked as tracked in p1 but not in manifest1
130 1 warnings encountered!
131 1 integrity errors encountered!
132 dirstate inconsistent with current parent's manifest
133 1 dirstate errors
134 [1]
123 $ cp -R .hg/store-full/. .hg/store 135 $ cp -R .hg/store-full/. .hg/store
124 136
125 Entire changelog and filelog missing 137 Entire changelog and filelog missing
126 138
127 $ rm .hg/store/00changelog.* 139 $ rm .hg/store/00changelog.*
132 manifest@1: 941fc4534185 not in changesets 144 manifest@1: 941fc4534185 not in changesets
133 warning: revlog 'data/file.i' not in fncache! 145 warning: revlog 'data/file.i' not in fncache!
134 ?: empty or missing file 146 ?: empty or missing file
135 file@0: manifest refers to unknown revision 362fef284ce2 147 file@0: manifest refers to unknown revision 362fef284ce2
136 file@1: manifest refers to unknown revision c10f2164107d 148 file@1: manifest refers to unknown revision c10f2164107d
149 not checking dirstate because of previous errors
137 1 warnings encountered! 150 1 warnings encountered!
138 hint: run "hg debugrebuildfncache" to recover from corrupt fncache 151 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
139 6 integrity errors encountered! 152 6 integrity errors encountered!
140 (first damaged changeset appears to be 0) 153 (first damaged changeset appears to be 0)
141 [1] 154 [1]
147 $ rm .hg/store/data/file.* 160 $ rm .hg/store/data/file.*
148 $ hg verify -q 161 $ hg verify -q
149 0: empty or missing manifest 162 0: empty or missing manifest
150 warning: revlog 'data/file.i' not in fncache! 163 warning: revlog 'data/file.i' not in fncache!
151 0: empty or missing file 164 0: empty or missing file
165 not checking dirstate because of previous errors
152 1 warnings encountered! 166 1 warnings encountered!
153 hint: run "hg debugrebuildfncache" to recover from corrupt fncache 167 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
154 2 integrity errors encountered! 168 2 integrity errors encountered!
155 (first damaged changeset appears to be 0) 169 (first damaged changeset appears to be 0)
156 [1] 170 [1]
162 $ hg verify -q 176 $ hg verify -q
163 manifest@?: rev 1 points to nonexistent changeset 1 177 manifest@?: rev 1 points to nonexistent changeset 1
164 manifest@?: 941fc4534185 not in changesets 178 manifest@?: 941fc4534185 not in changesets
165 file@?: rev 1 points to nonexistent changeset 1 179 file@?: rev 1 points to nonexistent changeset 1
166 (expected 0) 180 (expected 0)
181 not checking dirstate because of previous errors
167 1 warnings encountered! 182 1 warnings encountered!
168 3 integrity errors encountered! 183 3 integrity errors encountered!
169 [1] 184 [1]
170 $ cp -R .hg/store-full/. .hg/store 185 $ cp -R .hg/store-full/. .hg/store
171 186
173 188
174 $ cp -f .hg/store-partial/00manifest.* .hg/store 189 $ cp -f .hg/store-partial/00manifest.* .hg/store
175 $ hg verify -q 190 $ hg verify -q
176 manifest@1: changeset refers to unknown revision 941fc4534185 191 manifest@1: changeset refers to unknown revision 941fc4534185
177 file@1: c10f2164107d not in manifests 192 file@1: c10f2164107d not in manifests
193 not checking dirstate because of previous errors
178 2 integrity errors encountered! 194 2 integrity errors encountered!
179 (first damaged changeset appears to be 1) 195 (first damaged changeset appears to be 1)
180 [1] 196 [1]
181 $ cp -R .hg/store-full/. .hg/store 197 $ cp -R .hg/store-full/. .hg/store
182 198
183 Filelog missing entry 199 Filelog missing entry
184 200
185 $ cp -f .hg/store-partial/data/file.* .hg/store/data 201 $ cp -f .hg/store-partial/data/file.* .hg/store/data
186 $ hg verify -q 202 $ hg verify -q
187 file@1: manifest refers to unknown revision c10f2164107d 203 file@1: manifest refers to unknown revision c10f2164107d
204 not checking dirstate because of previous errors
188 1 integrity errors encountered! 205 1 integrity errors encountered!
189 (first damaged changeset appears to be 1) 206 (first damaged changeset appears to be 1)
190 [1] 207 [1]
191 $ cp -R .hg/store-full/. .hg/store 208 $ cp -R .hg/store-full/. .hg/store
192 209
196 $ cp -f .hg/store-partial/00manifest.* .hg/store 213 $ cp -f .hg/store-partial/00manifest.* .hg/store
197 $ hg verify -q 214 $ hg verify -q
198 file@?: rev 1 points to nonexistent changeset 1 215 file@?: rev 1 points to nonexistent changeset 1
199 (expected 0) 216 (expected 0)
200 file@?: c10f2164107d not in manifests 217 file@?: c10f2164107d not in manifests
218 not checking dirstate because of previous errors
201 1 warnings encountered! 219 1 warnings encountered!
202 2 integrity errors encountered! 220 2 integrity errors encountered!
203 [1] 221 [1]
204 $ cp -R .hg/store-full/. .hg/store 222 $ cp -R .hg/store-full/. .hg/store
205 223
209 $ cp -f .hg/store-partial/data/file.* .hg/store/data 227 $ cp -f .hg/store-partial/data/file.* .hg/store/data
210 $ hg verify -q 228 $ hg verify -q
211 manifest@?: rev 1 points to nonexistent changeset 1 229 manifest@?: rev 1 points to nonexistent changeset 1
212 manifest@?: 941fc4534185 not in changesets 230 manifest@?: 941fc4534185 not in changesets
213 file@?: manifest refers to unknown revision c10f2164107d 231 file@?: manifest refers to unknown revision c10f2164107d
232 not checking dirstate because of previous errors
214 3 integrity errors encountered! 233 3 integrity errors encountered!
215 [1] 234 [1]
216 $ cp -R .hg/store-full/. .hg/store 235 $ cp -R .hg/store-full/. .hg/store
217 236
218 Manifest and filelog missing entry 237 Manifest and filelog missing entry
219 238
220 $ cp -f .hg/store-partial/00manifest.* .hg/store 239 $ cp -f .hg/store-partial/00manifest.* .hg/store
221 $ cp -f .hg/store-partial/data/file.* .hg/store/data 240 $ cp -f .hg/store-partial/data/file.* .hg/store/data
222 $ hg verify -q 241 $ hg verify -q
223 manifest@1: changeset refers to unknown revision 941fc4534185 242 manifest@1: changeset refers to unknown revision 941fc4534185
243 not checking dirstate because of previous errors
224 1 integrity errors encountered! 244 1 integrity errors encountered!
225 (first damaged changeset appears to be 1) 245 (first damaged changeset appears to be 1)
226 [1] 246 [1]
227 $ cp -R .hg/store-full/. .hg/store 247 $ cp -R .hg/store-full/. .hg/store
228 248
234 0: unpacking changeset 08b1860757c2: * (glob) 254 0: unpacking changeset 08b1860757c2: * (glob)
235 manifest@?: rev 0 points to unexpected changeset 0 255 manifest@?: rev 0 points to unexpected changeset 0
236 manifest@?: d0b6632564d4 not in changesets 256 manifest@?: d0b6632564d4 not in changesets
237 file@?: rev 0 points to unexpected changeset 0 257 file@?: rev 0 points to unexpected changeset 0
238 (expected 1) 258 (expected 1)
259 not checking dirstate because of previous errors
239 1 warnings encountered! 260 1 warnings encountered!
240 4 integrity errors encountered! 261 4 integrity errors encountered!
241 (first damaged changeset appears to be 0) 262 (first damaged changeset appears to be 0)
242 [1] 263 [1]
243 $ cp -R .hg/store-full/. .hg/store 264 $ cp -R .hg/store-full/. .hg/store
247 $ printf abcd | dd conv=notrunc of=.hg/store/00manifest.i bs=1 seek=16 \ 268 $ printf abcd | dd conv=notrunc of=.hg/store/00manifest.i bs=1 seek=16 \
248 > 2> /dev/null 269 > 2> /dev/null
249 $ hg verify -q 270 $ hg verify -q
250 manifest@0: reading delta d0b6632564d4: * (glob) 271 manifest@0: reading delta d0b6632564d4: * (glob)
251 file@0: 362fef284ce2 not in manifests 272 file@0: 362fef284ce2 not in manifests
273 not checking dirstate because of previous errors
252 2 integrity errors encountered! 274 2 integrity errors encountered!
253 (first damaged changeset appears to be 0) 275 (first damaged changeset appears to be 0)
254 [1] 276 [1]
255 $ cp -R .hg/store-full/. .hg/store 277 $ cp -R .hg/store-full/. .hg/store
256 278
258 280
259 $ printf abcd | dd conv=notrunc of=.hg/store/data/file.i bs=1 seek=16 \ 281 $ printf abcd | dd conv=notrunc of=.hg/store/data/file.i bs=1 seek=16 \
260 > 2> /dev/null 282 > 2> /dev/null
261 $ hg verify -q 283 $ hg verify -q
262 file@0: unpacking 362fef284ce2: * (glob) 284 file@0: unpacking 362fef284ce2: * (glob)
285 not checking dirstate because of previous errors
263 1 integrity errors encountered! 286 1 integrity errors encountered!
264 (first damaged changeset appears to be 0) 287 (first damaged changeset appears to be 0)
265 [1] 288 [1]
266 $ cp -R .hg/store-full/. .hg/store 289 $ cp -R .hg/store-full/. .hg/store
267 290
288 $ cat start b > .hg/store/data/a.i 311 $ cat start b > .hg/store/data/a.i
289 312
290 $ hg verify -q 313 $ hg verify -q
291 a@1: broken revlog! (index a is corrupted) 314 a@1: broken revlog! (index a is corrupted)
292 warning: orphan data file 'data/a.i' 315 warning: orphan data file 'data/a.i'
316 not checking dirstate because of previous errors
293 1 warnings encountered! 317 1 warnings encountered!
294 1 integrity errors encountered! 318 1 integrity errors encountered!
295 (first damaged changeset appears to be 1) 319 (first damaged changeset appears to be 1)
296 [1] 320 [1]
297 321
305 repository uses revlog format 0 329 repository uses revlog format 0
306 checking changesets 330 checking changesets
307 checking manifests 331 checking manifests
308 crosschecking files in changesets and manifests 332 crosschecking files in changesets and manifests
309 checking files 333 checking files
334 checking dirstate
310 checked 1 changesets with 1 changes to 1 files 335 checked 1 changesets with 1 changes to 1 files
311 $ cd .. 336 $ cd ..
312 337
313 test flag processor and skipflags 338 test flag processor and skipflags
314 339
330 > breakbase64=$TESTTMP/break-base64.py 355 > breakbase64=$TESTTMP/break-base64.py
331 > EOF 356 > EOF
332 357
333 $ hg verify -q 358 $ hg verify -q
334 base64@0: unpacking 794cee7777cb: integrity check failed on base64:0 359 base64@0: unpacking 794cee7777cb: integrity check failed on base64:0
360 not checking dirstate because of previous errors
335 1 integrity errors encountered! 361 1 integrity errors encountered!
336 (first damaged changeset appears to be 0) 362 (first damaged changeset appears to be 0)
337 [1] 363 [1]
338 $ hg verify --config verify.skipflags=2147483647 -q 364 $ hg verify --config verify.skipflags=2147483647 -q
339 365