comparison tests/test-verify.t @ 11787:7830e693b704

tests: unify test-verify
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Thu, 12 Aug 2010 15:41:58 +0900
parents tests/test-verify@b33d70849a20
children 74f54b7775f2
comparison
equal deleted inserted replaced
11786:38e3f973a4f3 11787:7830e693b704
1 prepare repo
2
3 $ hg init a
4 $ cd a
5 $ echo "some text" > FOO.txt
6 $ echo "another text" > bar.txt
7 $ echo "more text" > QUICK.txt
8 $ hg add
9 adding FOO.txt
10 adding QUICK.txt
11 adding bar.txt
12 $ hg ci -mtest1
13
14 verify
15
16 $ hg verify
17 checking changesets
18 checking manifests
19 crosschecking files in changesets and manifests
20 checking files
21 3 files, 1 changesets, 3 total revisions
22
23 verify with journal
24
25 $ touch .hg/store/journal
26 $ hg verify
27 abandoned transaction found - run hg recover
28 checking changesets
29 checking manifests
30 crosschecking files in changesets and manifests
31 checking files
32 3 files, 1 changesets, 3 total revisions
33 $ rm .hg/store/journal
34
35 introduce some bugs in repo
36
37 $ cd .hg/store/data
38 $ mv _f_o_o.txt.i X_f_o_o.txt.i
39 $ mv bar.txt.i xbar.txt.i
40 $ rm _q_u_i_c_k.txt.i
41
42 $ hg verify
43 checking changesets
44 checking manifests
45 crosschecking files in changesets and manifests
46 checking files
47 data/FOO.txt.i@0: missing revlog!
48 0: empty or missing FOO.txt
49 FOO.txt@0: f62022d3d590 in manifests not found
50 data/QUICK.txt.i@0: missing revlog!
51 0: empty or missing QUICK.txt
52 QUICK.txt@0: 88b857db8eba in manifests not found
53 data/bar.txt.i@0: missing revlog!
54 0: empty or missing bar.txt
55 bar.txt@0: 256559129457 in manifests not found
56 3 files, 1 changesets, 0 total revisions
57 9 integrity errors encountered!
58 (first damaged changeset appears to be 0)
59
60 $ cd ..
61
62 test revlog corruption
63
64 $ hg init b
65 $ cd b
66
67 $ touch a
68 $ hg add a
69 $ hg ci -m a
70
71 $ echo 'corrupted' > b
72 $ dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null
73 $ cat start b > .hg/store/data/a.i
74
75 $ hg verify
76 checking changesets
77 checking manifests
78 crosschecking files in changesets and manifests
79 checking files
80 a@0: broken revlog! (index data/a.i is corrupted)
81 warning: orphan revlog 'data/a.i'
82 1 files, 1 changesets, 0 total revisions
83 1 warnings encountered!
84 1 integrity errors encountered!
85 (first damaged changeset appears to be 0)
86
87 $ exit 0