##// END OF EJS Templates
test-cache-abuse: correct for different hunk headers between Solaris and GNU...
Danek Duvall -
r29255:b0b85d86 stable
parent child Browse files
Show More
@@ -1,100 +1,100
1 Enable obsolete markers
1 Enable obsolete markers
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [experimental]
4 > [experimental]
5 > evolution=createmarkers
5 > evolution=createmarkers
6 > [phases]
6 > [phases]
7 > publish=False
7 > publish=False
8 > EOF
8 > EOF
9
9
10 Build a repo with some cacheable bits:
10 Build a repo with some cacheable bits:
11
11
12 $ hg init a
12 $ hg init a
13 $ cd a
13 $ cd a
14
14
15 $ echo a > a
15 $ echo a > a
16 $ hg ci -qAm0
16 $ hg ci -qAm0
17 $ hg tag t1
17 $ hg tag t1
18 $ hg book -i bk1
18 $ hg book -i bk1
19
19
20 $ hg branch -q b2
20 $ hg branch -q b2
21 $ hg ci -Am1
21 $ hg ci -Am1
22 $ hg tag t2
22 $ hg tag t2
23
23
24 $ echo dumb > dumb
24 $ echo dumb > dumb
25 $ hg ci -qAmdumb
25 $ hg ci -qAmdumb
26 $ hg debugobsolete b1174d11b69e63cb0c5726621a43c859f0858d7f
26 $ hg debugobsolete b1174d11b69e63cb0c5726621a43c859f0858d7f
27
27
28 $ hg phase -pr t1
28 $ hg phase -pr t1
29 $ hg phase -fsr t2
29 $ hg phase -fsr t2
30
30
31 Make a helper function to check cache damage invariants:
31 Make a helper function to check cache damage invariants:
32
32
33 - command output shouldn't change
33 - command output shouldn't change
34 - cache should be present after first use
34 - cache should be present after first use
35 - corruption/repair should be silent (no exceptions or warnings)
35 - corruption/repair should be silent (no exceptions or warnings)
36 - cache should survive deletion, overwrite, and append
36 - cache should survive deletion, overwrite, and append
37 - unreadable / unwriteable caches should be ignored
37 - unreadable / unwriteable caches should be ignored
38 - cache should be rebuilt after corruption
38 - cache should be rebuilt after corruption
39
39
40 $ damage() {
40 $ damage() {
41 > CMD=$1
41 > CMD=$1
42 > CACHE=.hg/cache/$2
42 > CACHE=.hg/cache/$2
43 > CLEAN=$3
43 > CLEAN=$3
44 > hg $CMD > before
44 > hg $CMD > before
45 > test -f $CACHE || echo "not present"
45 > test -f $CACHE || echo "not present"
46 > echo bad > $CACHE
46 > echo bad > $CACHE
47 > test -z "$CLEAN" || $CLEAN
47 > test -z "$CLEAN" || $CLEAN
48 > hg $CMD > after
48 > hg $CMD > after
49 > diff -u before after || echo "*** overwrite corruption"
49 > diff -u before after || echo "*** overwrite corruption"
50 > echo corruption >> $CACHE
50 > echo corruption >> $CACHE
51 > test -z "$CLEAN" || $CLEAN
51 > test -z "$CLEAN" || $CLEAN
52 > hg $CMD > after
52 > hg $CMD > after
53 > diff -u before after || echo "*** append corruption"
53 > diff -u before after || echo "*** append corruption"
54 > rm $CACHE
54 > rm $CACHE
55 > mkdir $CACHE
55 > mkdir $CACHE
56 > test -z "$CLEAN" || $CLEAN
56 > test -z "$CLEAN" || $CLEAN
57 > hg $CMD > after
57 > hg $CMD > after
58 > diff -u before after || echo "*** read-only corruption"
58 > diff -u before after || echo "*** read-only corruption"
59 > test -d $CACHE || echo "*** directory clobbered"
59 > test -d $CACHE || echo "*** directory clobbered"
60 > rmdir $CACHE
60 > rmdir $CACHE
61 > test -z "$CLEAN" || $CLEAN
61 > test -z "$CLEAN" || $CLEAN
62 > hg $CMD > after
62 > hg $CMD > after
63 > diff -u before after || echo "*** missing corruption"
63 > diff -u before after || echo "*** missing corruption"
64 > test -f $CACHE || echo "not rebuilt"
64 > test -f $CACHE || echo "not rebuilt"
65 > }
65 > }
66
66
67 Beat up tags caches:
67 Beat up tags caches:
68
68
69 $ damage "tags --hidden" tags2
69 $ damage "tags --hidden" tags2
70 $ damage tags tags2-visible
70 $ damage tags tags2-visible
71 $ damage "tag -f t3" hgtagsfnodes1
71 $ damage "tag -f t3" hgtagsfnodes1
72
72
73 Beat up hidden cache:
73 Beat up hidden cache:
74
74
75 $ damage log hidden
75 $ damage log hidden
76
76
77 Beat up branch caches:
77 Beat up branch caches:
78
78
79 $ damage branches branch2-base "rm .hg/cache/branch2-[vs]*"
79 $ damage branches branch2-base "rm .hg/cache/branch2-[vs]*"
80 $ damage branches branch2-served "rm .hg/cache/branch2-[bv]*"
80 $ damage branches branch2-served "rm .hg/cache/branch2-[bv]*"
81 $ damage branches branch2-visible
81 $ damage branches branch2-visible
82 $ damage "log -r branch(.)" rbc-names-v1
82 $ damage "log -r branch(.)" rbc-names-v1
83 $ damage "log -r branch(default)" rbc-names-v1
83 $ damage "log -r branch(default)" rbc-names-v1
84 $ damage "log -r branch(b2)" rbc-revs-v1
84 $ damage "log -r branch(b2)" rbc-revs-v1
85
85
86 We currently can't detect an rbc cache with unknown names:
86 We currently can't detect an rbc cache with unknown names:
87
87
88 $ damage "log -qr branch(b2)" rbc-names-v1
88 $ damage "log -qr branch(b2)" rbc-names-v1
89 --- before * (glob)
89 --- before * (glob)
90 +++ after * (glob)
90 +++ after * (glob)
91 @@ -1,8 +0,0 @@
91 @@ -1,8 +?,0 @@ (glob)
92 -2:5fb7d38b9dc4
92 -2:5fb7d38b9dc4
93 -3:60b597ffdafa
93 -3:60b597ffdafa
94 -4:b1174d11b69e
94 -4:b1174d11b69e
95 -5:6354685872c0
95 -5:6354685872c0
96 -6:5ebc725f1bef
96 -6:5ebc725f1bef
97 -7:7b76eec2f273
97 -7:7b76eec2f273
98 -8:ef3428d9d644
98 -8:ef3428d9d644
99 -9:ba7a936bc03c
99 -9:ba7a936bc03c
100 *** append corruption
100 *** append corruption
General Comments 0
You need to be logged in to leave comments. Login now