Show More
@@ -1,72 +1,72 | |||
|
1 | 1 | #require no-windows |
|
2 | 2 | |
|
3 | 3 | $ . "$TESTDIR/remotefilelog-library.sh" |
|
4 | 4 | |
|
5 | 5 | $ hg init master |
|
6 | 6 | $ cd master |
|
7 | 7 | $ cat >> .hg/hgrc <<EOF |
|
8 | 8 | > [remotefilelog] |
|
9 | 9 | > server=True |
|
10 | 10 | > EOF |
|
11 | 11 | $ echo x > x |
|
12 | 12 | $ echo y > y |
|
13 | 13 | $ echo z > z |
|
14 | 14 | $ hg commit -qAm xy |
|
15 | 15 | |
|
16 | 16 | $ cd .. |
|
17 | 17 | |
|
18 | 18 | $ hgcloneshallow ssh://user@dummy/master shallow -q |
|
19 | 19 | 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob) |
|
20 | 20 | $ cd shallow |
|
21 | 21 | |
|
22 | 22 | Verify corrupt cache handling repairs by default |
|
23 | 23 | |
|
24 | 24 | $ hg up -q null |
|
25 | 25 | $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 |
|
26 | 26 | $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 |
|
27 | 27 | $ hg up tip |
|
28 | 28 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
29 | 29 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
|
30 | 30 | |
|
31 | 31 | Verify corrupt cache error message |
|
32 | 32 | |
|
33 | 33 | $ hg up -q null |
|
34 | 34 | $ cat >> .hg/hgrc <<EOF |
|
35 | 35 | > [remotefilelog] |
|
36 | 36 | > validatecache=off |
|
37 | 37 | > EOF |
|
38 | 38 | $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 |
|
39 | 39 | $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 |
|
40 |
$ hg up tip 2>&1 | egrep "^ |
|
|
40 | $ hg up tip 2>&1 | egrep "^[^ ].*unexpected remotefilelog" | |
|
41 | 41 | RuntimeError: unexpected remotefilelog header: illegal format |
|
42 | 42 | |
|
43 | 43 | Verify detection and remediation when remotefilelog.validatecachelog is set |
|
44 | 44 | |
|
45 | 45 | $ cat >> .hg/hgrc <<EOF |
|
46 | 46 | > [remotefilelog] |
|
47 | 47 | > validatecachelog=$PWD/.hg/remotefilelog_cache.log |
|
48 | 48 | > validatecache=strict |
|
49 | 49 | > EOF |
|
50 | 50 | $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 |
|
51 | 51 | $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 |
|
52 | 52 | $ hg up tip |
|
53 | 53 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
54 | 54 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
|
55 | 55 | $ cat .hg/remotefilelog_cache.log |
|
56 | 56 | corrupt $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 during contains |
|
57 | 57 | |
|
58 | 58 | Verify handling of corrupt server cache |
|
59 | 59 | |
|
60 | 60 | $ rm -f ../master/.hg/remotefilelogcache/y/076f5e2225b3ff0400b98c92aa6cdf403ee24cca |
|
61 | 61 | $ touch ../master/.hg/remotefilelogcache/y/076f5e2225b3ff0400b98c92aa6cdf403ee24cca |
|
62 | 62 | $ clearcache |
|
63 | 63 | $ hg prefetch -r . |
|
64 | 64 | 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob) |
|
65 | 65 | $ test -s ../master/.hg/remotefilelogcache/y/076f5e2225b3ff0400b98c92aa6cdf403ee24cca |
|
66 | 66 | $ hg debugremotefilelog $CACHEDIR/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca |
|
67 | 67 | size: 2 bytes |
|
68 | 68 | path: $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca |
|
69 | 69 | key: 076f5e2225b3 |
|
70 | 70 | |
|
71 | 71 | node => p1 p2 linknode copyfrom |
|
72 | 72 | 076f5e2225b3 => 000000000000 000000000000 f3d0bb0d1e48 |
General Comments 0
You need to be logged in to leave comments.
Login now