##// END OF EJS Templates
test: generate the `test-sparse-revlog` artifact when slow-test is allowed...
marmoute -
r41970:090a4125 default
parent child Browse files
Show More
@@ -1,136 +1,148 b''
1 1 ====================================
2 2 Test delta choice with sparse revlog
3 3 ====================================
4 4
5 5 Sparse-revlog usually shows the most gain on Manifest. However, it is simpler
6 6 to general an appropriate file, so we test with a single file instead. The
7 7 goal is to observe intermediate snapshot being created.
8 8
9 9 We need a large enough file. Part of the content needs to be replaced
10 10 repeatedly while some of it changes rarely.
11 11
12 12 $ bundlepath="$TESTDIR/artifacts/cache/big-file-churn.hg"
13 13
14 14 $ expectedhash=`cat "$bundlepath".md5`
15
16 #if slow
17
18 $ if [ ! -f "$bundlepath" ]; then
19 > "$TESTDIR"/artifacts/scripts/generate-churning-bundle.py > /dev/null
20 > fi
21
22 #else
23
15 24 $ if [ ! -f "$bundlepath" ]; then
16 25 > echo 'skipped: missing artifact, run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"'
17 26 > exit 80
18 27 > fi
28
29 #endif
30
19 31 $ currenthash=`f -M "$bundlepath" | cut -d = -f 2`
20 32 $ if [ "$currenthash" != "$expectedhash" ]; then
21 33 > echo 'skipped: outdated artifact, md5 "'"$currenthash"'" expected "'"$expectedhash"'" run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"'
22 34 > exit 80
23 35 > fi
24 36
25 37 $ cat >> $HGRCPATH << EOF
26 38 > [format]
27 39 > sparse-revlog = yes
28 40 > maxchainlen = 15
29 41 > [storage]
30 42 > revlog.optimize-delta-parent-choice = yes
31 43 > [format]
32 44 > generaldelta = yes
33 45 > EOF
34 46 $ hg init sparse-repo
35 47 $ cd sparse-repo
36 48 $ hg unbundle $bundlepath
37 49 adding changesets
38 50 adding manifests
39 51 adding file changes
40 52 added 5001 changesets with 5001 changes to 1 files (+89 heads)
41 53 new changesets 9706f5af64f4:d9032adc8114 (5001 drafts)
42 54 (run 'hg heads' to see heads, 'hg merge' to merge)
43 55 $ hg up
44 56 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 57 updated to "d9032adc8114: commit #5000"
46 58 89 other heads for branch "default"
47 59
48 60 $ hg log --stat -r 0:3
49 61 changeset: 0:9706f5af64f4
50 62 user: test
51 63 date: Thu Jan 01 00:00:00 1970 +0000
52 64 summary: initial commit
53 65
54 66 SPARSE-REVLOG-TEST-FILE | 10500 ++++++++++++++++++++++++++++++++++++++++++++++
55 67 1 files changed, 10500 insertions(+), 0 deletions(-)
56 68
57 69 changeset: 1:724907deaa5e
58 70 user: test
59 71 date: Thu Jan 01 00:00:00 1970 +0000
60 72 summary: commit #1
61 73
62 74 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++-----------------------
63 75 1 files changed, 534 insertions(+), 534 deletions(-)
64 76
65 77 changeset: 2:62c41bce3e5d
66 78 user: test
67 79 date: Thu Jan 01 00:00:00 1970 +0000
68 80 summary: commit #2
69 81
70 82 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++-----------------------
71 83 1 files changed, 534 insertions(+), 534 deletions(-)
72 84
73 85 changeset: 3:348a9cbd6959
74 86 user: test
75 87 date: Thu Jan 01 00:00:00 1970 +0000
76 88 summary: commit #3
77 89
78 90 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++-----------------------
79 91 1 files changed, 534 insertions(+), 534 deletions(-)
80 92
81 93
82 94 $ f -s .hg/store/data/*.d
83 95 .hg/store/data/_s_p_a_r_s_e-_r_e_v_l_o_g-_t_e_s_t-_f_i_l_e.d: size=63327412
84 96 $ hg debugrevlog *
85 97 format : 1
86 98 flags : generaldelta
87 99
88 100 revisions : 5001
89 101 merges : 625 (12.50%)
90 102 normal : 4376 (87.50%)
91 103 revisions : 5001
92 104 empty : 0 ( 0.00%)
93 105 text : 0 (100.00%)
94 106 delta : 0 (100.00%)
95 107 snapshot : 383 ( 7.66%)
96 108 lvl-0 : 3 ( 0.06%)
97 109 lvl-1 : 20 ( 0.40%)
98 110 lvl-2 : 68 ( 1.36%)
99 111 lvl-3 : 112 ( 2.24%)
100 112 lvl-4 : 180 ( 3.60%)
101 113 deltas : 4618 (92.34%)
102 114 revision size : 63327412
103 115 snapshot : 9886710 (15.61%)
104 116 lvl-0 : 603104 ( 0.95%)
105 117 lvl-1 : 1559991 ( 2.46%)
106 118 lvl-2 : 2295592 ( 3.62%)
107 119 lvl-3 : 2531199 ( 4.00%)
108 120 lvl-4 : 2896824 ( 4.57%)
109 121 deltas : 53440702 (84.39%)
110 122
111 123 chunks : 5001
112 124 0x78 (x) : 5001 (100.00%)
113 125 chunks size : 63327412
114 126 0x78 (x) : 63327412 (100.00%)
115 127
116 128 avg chain length : 9
117 129 max chain length : 15
118 130 max chain reach : 28248745
119 131 compression ratio : 27
120 132
121 133 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471
122 134 full revision size (min/max/avg) : 201008 / 201050 / 201034
123 135 inter-snapshot size (min/max/avg) : 11596 / 168150 / 24430
124 136 level-1 (min/max/avg) : 16653 / 168150 / 77999
125 137 level-2 (min/max/avg) : 12951 / 85595 / 33758
126 138 level-3 (min/max/avg) : 11608 / 43029 / 22599
127 139 level-4 (min/max/avg) : 11596 / 21632 / 16093
128 140 delta size (min/max/avg) : 10649 / 107163 / 11572
129 141
130 142 deltas against prev : 3910 (84.67%)
131 143 where prev = p1 : 3910 (100.00%)
132 144 where prev = p2 : 0 ( 0.00%)
133 145 other : 0 ( 0.00%)
134 146 deltas against p1 : 648 (14.03%)
135 147 deltas against p2 : 60 ( 1.30%)
136 148 deltas against other : 0 ( 0.00%)
General Comments 0
You need to be logged in to leave comments. Login now