Show More
@@ -460,7 +460,10 b' class revlog(object):' | |||
|
460 | 460 | if self.version == REVLOGV0: |
|
461 | 461 | self._io = revlogoldio() |
|
462 | 462 | if i: |
|
463 | d = self._io.parseindex(f, self._inline) | |
|
463 | try: | |
|
464 | d = self._io.parseindex(f, self._inline) | |
|
465 | except (ValueError, IndexError), e: | |
|
466 | raise RevlogError(_("index %s is corrupted") % (self.indexfile)) | |
|
464 | 467 | self.index, self.nodemap, self._chunkcache = d |
|
465 | 468 | |
|
466 | 469 | # add the magic null revision at -1 (if it hasn't been done already) |
@@ -1,7 +1,8 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo % prepare repo |
|
4 | hg init | |
|
4 | hg init a | |
|
5 | cd a | |
|
5 | 6 | echo "some text" > FOO.txt |
|
6 | 7 | echo "another text" > bar.txt |
|
7 | 8 | echo "more text" > QUICK.txt |
@@ -23,4 +24,22 b' echo' | |||
|
23 | 24 | echo % verify |
|
24 | 25 | hg verify |
|
25 | 26 | |
|
27 | cd .. | |
|
28 | ||
|
29 | echo % test revlog corruption | |
|
30 | hg init b | |
|
31 | cd b | |
|
32 | ||
|
33 | touch a | |
|
34 | hg add a | |
|
35 | hg ci -m a | |
|
36 | ||
|
37 | echo 'corrupted' > b | |
|
38 | head -c 20 .hg/store/data/a.i > start | |
|
39 | cat start b > .hg/store/data/a.i | |
|
40 | ||
|
41 | echo | |
|
42 | echo % verify | |
|
43 | hg verify | |
|
44 | ||
|
26 | 45 | exit 0 |
@@ -29,3 +29,16 b' checking files' | |||
|
29 | 29 | 3 files, 1 changesets, 0 total revisions |
|
30 | 30 | 9 integrity errors encountered! |
|
31 | 31 | (first damaged changeset appears to be 0) |
|
32 | % test revlog corruption | |
|
33 | ||
|
34 | % verify | |
|
35 | checking changesets | |
|
36 | checking manifests | |
|
37 | crosschecking files in changesets and manifests | |
|
38 | checking files | |
|
39 | a@0: broken revlog! (index data/a.i is corrupted) | |
|
40 | warning: orphan revlog 'data/a.i' | |
|
41 | 1 files, 1 changesets, 0 total revisions | |
|
42 | 1 warnings encountered! | |
|
43 | 1 integrity errors encountered! | |
|
44 | (first damaged changeset appears to be 0) |
General Comments 0
You need to be logged in to leave comments.
Login now