##// END OF EJS Templates
test: change repair strip test to illustrate manifest errors
Henrik Stuart -
r8293:f00573bc default
parent child Browse files
Show More
@@ -1,36 +1,40
1 #!/bin/sh
1 #!/bin/sh
2
2
3 echo "[extensions]" >> $HGRCPATH
3 echo "[extensions]" >> $HGRCPATH
4 echo "mq=">> $HGRCPATH
4 echo "mq=">> $HGRCPATH
5
5
6 teststrip() {
6 teststrip() {
7 hg -q up -C $1
7 hg -q up -C $1
8 echo % before update $1, strip $2
8 echo % before update $1, strip $2
9 hg parents
9 hg parents
10 chmod -$3 $4
10 chmod -$3 $4
11 hg strip $2 2>&1 | sed 's/\(saving bundle to \).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/'
11 hg strip $2 2>&1 | sed 's/\(saving bundle to \).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/'
12 echo % after update $1, strip $2
12 echo % after update $1, strip $2
13 chmod +$3 $4
13 chmod +$3 $4
14 hg verify
14 hg verify
15 echo % journal contents
15 echo % journal contents
16 cat .hg/store/journal | sed 's/\.i[^\n]*/\.i/'
16 cat .hg/store/journal | sed 's/\.i[^\n]*/\.i/'
17 ls .hg/store/journal >/dev/null 2>&1 && hg recover
17 ls .hg/store/journal >/dev/null 2>&1 && hg recover
18 ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/*
18 ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/*
19 rm -rf .hg/strip-backup
19 rm -rf .hg/strip-backup
20 }
20 }
21
21
22 hg init test
22 hg init test
23 cd test
23 cd test
24
24
25 echo a > a
25 echo a > a
26 hg -q ci -m "a" -A
26 hg -q ci -m "a" -A
27
27
28 echo b > b
28 echo b > b
29 hg -q ci -m "b" -A
29 hg -q ci -m "b" -A
30
30
31 echo b2 >> b
32 hg -q ci -m "b2" -A
33
31 echo c > c
34 echo c > c
32 hg -q ci -m "c" -A
35 hg -q ci -m "c" -A
36
37 teststrip 0 2 w .hg/store/data/b.i
38 teststrip 0 2 r .hg/store/data/b.i
39 teststrip 0 2 w .hg/store/00manifest.i
33
40
34 teststrip 0 1 w .hg/store/data/b.i
35 teststrip 0 1 r .hg/store/data/b.i
36 teststrip 0 1 w .hg/store/00changelog.i
@@ -1,83 +1,85
1 % before update 0, strip 1
1 % before update 0, strip 2
2 changeset: 0:cb9a9f314b8b
2 changeset: 0:cb9a9f314b8b
3 user: test
3 user: test
4 date: Thu Jan 01 00:00:00 1970 +0000
4 date: Thu Jan 01 00:00:00 1970 +0000
5 summary: a
5 summary: a
6
6
7 saving bundle to
7 saving bundle to
8 transaction abort!
8 transaction abort!
9 failed to truncate data/b.i
9 failed to truncate data/b.i
10 rollback failed - please run hg recover
10 rollback failed - please run hg recover
11 abort: Permission denied .hg/store/data/b.i
11 abort: Permission denied .hg/store/data/b.i
12 % after update 0, strip 1
12 % after update 0, strip 2
13 checking changesets
13 checking changesets
14 checking manifests
14 checking manifests
15 crosschecking files in changesets and manifests
15 crosschecking files in changesets and manifests
16 checking files
16 checking files
17 warning: orphan revlog 'data/b.i'
17 b@?: rev 1 points to nonexistent changeset 2
18 1 files, 1 changesets, 1 total revisions
18 (expected 1)
19 b@?: 736c29771fba not in manifests
20 2 files, 2 changesets, 3 total revisions
19 1 warnings encountered!
21 1 warnings encountered!
22 2 integrity errors encountered!
20 % journal contents
23 % journal contents
21 00changelog.i
24 00changelog.i
22 00manifest.i
25 00manifest.i
23 data/b.i
26 data/b.i
24 data/c.i
27 data/c.i
25 rolling back interrupted transaction
28 rolling back interrupted transaction
26 checking changesets
29 checking changesets
27 checking manifests
30 checking manifests
28 crosschecking files in changesets and manifests
31 crosschecking files in changesets and manifests
29 checking files
32 checking files
30 1 files, 1 changesets, 1 total revisions
33 2 files, 2 changesets, 2 total revisions
31 % before update 0, strip 1
34 % before update 0, strip 2
32 changeset: 0:cb9a9f314b8b
35 changeset: 0:cb9a9f314b8b
33 user: test
36 user: test
34 date: Thu Jan 01 00:00:00 1970 +0000
37 date: Thu Jan 01 00:00:00 1970 +0000
35 summary: a
38 summary: a
36
39
37 abort: Permission denied .hg/store/data/b.i
40 abort: Permission denied .hg/store/data/b.i
38 % after update 0, strip 1
41 % after update 0, strip 2
39 checking changesets
42 checking changesets
40 checking manifests
43 checking manifests
41 crosschecking files in changesets and manifests
44 crosschecking files in changesets and manifests
42 checking files
45 checking files
43 3 files, 3 changesets, 3 total revisions
46 3 files, 4 changesets, 4 total revisions
44 % journal contents
47 % journal contents
45 cat: .hg/store/journal: No such file or directory
48 cat: .hg/store/journal: No such file or directory
46 % before update 0, strip 1
49 % before update 0, strip 2
47 changeset: 0:cb9a9f314b8b
50 changeset: 0:cb9a9f314b8b
48 user: test
51 user: test
49 date: Thu Jan 01 00:00:00 1970 +0000
52 date: Thu Jan 01 00:00:00 1970 +0000
50 summary: a
53 summary: a
51
54
52 saving bundle to
55 saving bundle to
53 transaction abort!
56 transaction abort!
54 failed to truncate 00changelog.i
57 failed to truncate 00manifest.i
55 rollback failed - please run hg recover
58 rollback failed - please run hg recover
56 abort: Permission denied .hg/store/00changelog.i
59 abort: Permission denied .hg/store/00manifest.i
57 % after update 0, strip 1
60 % after update 0, strip 2
58 checking changesets
61 checking changesets
59 checking manifests
62 checking manifests
63 manifest@?: rev 2 points to nonexistent changeset 2
64 manifest@?: rev 3 points to nonexistent changeset 3
60 crosschecking files in changesets and manifests
65 crosschecking files in changesets and manifests
61 1: changeset refers to unknown manifest a539ce0c1a22
66 c@?: in manifest but not in changeset
62 2: changeset refers to unknown manifest e3738bf54399
63 b@1: in changeset but not in manifest
64 c@2: in changeset but not in manifest
65 checking files
67 checking files
66 data/b.i@1: missing revlog!
68 b@2: 736c29771fba in manifests not found
67 1: empty or missing b
69 data/c.i@?: missing revlog!
68 data/c.i@2: missing revlog!
70 ?: empty or missing c
69 2: empty or missing c
71 c@3: 149da44f2a4e in manifests not found
70 3 files, 3 changesets, 1 total revisions
72 3 files, 2 changesets, 2 total revisions
71 8 integrity errors encountered!
73 7 integrity errors encountered!
72 (first damaged changeset appears to be 1)
74 (first damaged changeset appears to be 2)
73 % journal contents
75 % journal contents
74 00changelog.i
76 00changelog.i
75 00manifest.i
77 00manifest.i
76 data/b.i
78 data/b.i
77 data/c.i
79 data/c.i
78 rolling back interrupted transaction
80 rolling back interrupted transaction
79 checking changesets
81 checking changesets
80 checking manifests
82 checking manifests
81 crosschecking files in changesets and manifests
83 crosschecking files in changesets and manifests
82 checking files
84 checking files
83 1 files, 1 changesets, 1 total revisions
85 2 files, 2 changesets, 2 total revisions
General Comments 0
You need to be logged in to leave comments. Login now