##// END OF EJS Templates
tests: unify test-verify
Nicolas Dumazet -
r11787:7830e693 default
parent child Browse files
Show More
@@ -1,51 +1,87 b''
1 #!/bin/sh
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
2
15
3 echo % prepare repo
16 $ hg verify
4 hg init a
17 checking changesets
5 cd a
18 checking manifests
6 echo "some text" > FOO.txt
19 crosschecking files in changesets and manifests
7 echo "another text" > bar.txt
20 checking files
8 echo "more text" > QUICK.txt
21 3 files, 1 changesets, 3 total revisions
9 hg add
22
10 hg ci -mtest1
23 verify with journal
11
24
12 echo
25 $ touch .hg/store/journal
13 echo % verify
26 $ hg verify
14 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
15
34
16 echo
35 introduce some bugs in repo
17 echo % verify with journal
36
18 touch .hg/store/journal
37 $ cd .hg/store/data
19 hg verify
38 $ mv _f_o_o.txt.i X_f_o_o.txt.i
20 rm .hg/store/journal
39 $ mv bar.txt.i xbar.txt.i
40 $ rm _q_u_i_c_k.txt.i
21
41
22 echo
42 $ hg verify
23 echo % introduce some bugs in repo
43 checking changesets
24 cd .hg/store/data
44 checking manifests
25 mv _f_o_o.txt.i X_f_o_o.txt.i
45 crosschecking files in changesets and manifests
26 mv bar.txt.i xbar.txt.i
46 checking files
27 rm _q_u_i_c_k.txt.i
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)
28
59
29 echo
60 $ cd ..
30 echo % verify
31 hg verify
32
61
33 cd ..
62 test revlog corruption
34
63
35 echo % test revlog corruption
64 $ hg init b
36 hg init b
65 $ cd b
37 cd b
38
66
39 touch a
67 $ touch a
40 hg add a
68 $ hg add a
41 hg ci -m 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
42
74
43 echo 'corrupted' > b
75 $ hg verify
44 dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null
76 checking changesets
45 cat start b > .hg/store/data/a.i
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)
46
86
47 echo
87 $ exit 0
48 echo % verify
49 hg verify
50
51 exit 0
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now