Show More
@@ -450,7 +450,10 b' class revlog(object):' | |||||
450 | if self.version == REVLOGV0: |
|
450 | if self.version == REVLOGV0: | |
451 | self._io = revlogoldio() |
|
451 | self._io = revlogoldio() | |
452 | if i: |
|
452 | if i: | |
453 | d = self._io.parseindex(f, self._inline) |
|
453 | try: | |
|
454 | d = self._io.parseindex(f, self._inline) | |||
|
455 | except (ValueError, IndexError), e: | |||
|
456 | raise RevlogError(_("index %s is corrupted") % (self.indexfile)) | |||
454 | self.index, self.nodemap, self._chunkcache = d |
|
457 | self.index, self.nodemap, self._chunkcache = d | |
455 |
|
458 | |||
456 | # add the magic null revision at -1 (if it hasn't been done already) |
|
459 | # add the magic null revision at -1 (if it hasn't been done already) |
@@ -1,7 +1,8 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | echo % prepare repo |
|
3 | echo % prepare repo | |
4 | hg init |
|
4 | hg init a | |
|
5 | cd a | |||
5 | echo "some text" > FOO.txt |
|
6 | echo "some text" > FOO.txt | |
6 | echo "another text" > bar.txt |
|
7 | echo "another text" > bar.txt | |
7 | echo "more text" > QUICK.txt |
|
8 | echo "more text" > QUICK.txt | |
@@ -23,4 +24,22 b' echo' | |||||
23 | echo % verify |
|
24 | echo % verify | |
24 | hg verify |
|
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 | exit 0 |
|
45 | exit 0 |
@@ -29,3 +29,16 b' checking files' | |||||
29 | 3 files, 1 changesets, 0 total revisions |
|
29 | 3 files, 1 changesets, 0 total revisions | |
30 | 9 integrity errors encountered! |
|
30 | 9 integrity errors encountered! | |
31 | (first damaged changeset appears to be 0) |
|
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