Show More
@@ -1,194 +1,194 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 | 15 | |
|
16 | 16 | #if slow |
|
17 | 17 | |
|
18 | 18 | $ if [ ! -f "$bundlepath" ]; then |
|
19 | 19 | > "$TESTDIR"/artifacts/scripts/generate-churning-bundle.py > /dev/null |
|
20 | 20 | > fi |
|
21 | 21 | |
|
22 | 22 | #else |
|
23 | 23 | |
|
24 | 24 | $ if [ ! -f "$bundlepath" ]; then |
|
25 | 25 | > echo 'skipped: missing artifact, run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"' |
|
26 | 26 | > exit 80 |
|
27 | 27 | > fi |
|
28 | 28 | |
|
29 | 29 | #endif |
|
30 | 30 | |
|
31 | 31 | $ currenthash=`f -M "$bundlepath" | cut -d = -f 2` |
|
32 | 32 | $ if [ "$currenthash" != "$expectedhash" ]; then |
|
33 | 33 | > echo 'skipped: outdated artifact, md5 "'"$currenthash"'" expected "'"$expectedhash"'" run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"' |
|
34 | 34 | > exit 80 |
|
35 | 35 | > fi |
|
36 | 36 | |
|
37 | 37 | $ cat >> $HGRCPATH << EOF |
|
38 | 38 | > [format] |
|
39 | 39 | > sparse-revlog = yes |
|
40 | 40 | > maxchainlen = 15 |
|
41 | 41 | > [storage] |
|
42 | 42 | > revlog.optimize-delta-parent-choice = yes |
|
43 | 43 | > revlog.reuse-external-delta = no |
|
44 | 44 | > EOF |
|
45 | 45 | $ hg init sparse-repo |
|
46 | 46 | $ cd sparse-repo |
|
47 | 47 | $ hg unbundle $bundlepath |
|
48 | 48 | adding changesets |
|
49 | 49 | adding manifests |
|
50 | 50 | adding file changes |
|
51 | 51 | added 5001 changesets with 5001 changes to 1 files (+89 heads) |
|
52 | 52 | new changesets 9706f5af64f4:d9032adc8114 (5001 drafts) |
|
53 | 53 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
54 | 54 | $ hg up |
|
55 | 55 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
56 | 56 | updated to "d9032adc8114: commit #5000" |
|
57 | 57 | 89 other heads for branch "default" |
|
58 | 58 | |
|
59 | 59 | $ hg log --stat -r 0:3 |
|
60 | 60 | changeset: 0:9706f5af64f4 |
|
61 | 61 | user: test |
|
62 | 62 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
63 | 63 | summary: initial commit |
|
64 | 64 | |
|
65 | 65 | SPARSE-REVLOG-TEST-FILE | 10500 ++++++++++++++++++++++++++++++++++++++++++++++ |
|
66 | 66 | 1 files changed, 10500 insertions(+), 0 deletions(-) |
|
67 | 67 | |
|
68 | 68 | changeset: 1:724907deaa5e |
|
69 | 69 | user: test |
|
70 | 70 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
71 | 71 | summary: commit #1 |
|
72 | 72 | |
|
73 | 73 | SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++----------------------- |
|
74 | 74 | 1 files changed, 534 insertions(+), 534 deletions(-) |
|
75 | 75 | |
|
76 | 76 | changeset: 2:62c41bce3e5d |
|
77 | 77 | user: test |
|
78 | 78 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
79 | 79 | summary: commit #2 |
|
80 | 80 | |
|
81 | 81 | SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++----------------------- |
|
82 | 82 | 1 files changed, 534 insertions(+), 534 deletions(-) |
|
83 | 83 | |
|
84 | 84 | changeset: 3:348a9cbd6959 |
|
85 | 85 | user: test |
|
86 | 86 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
87 | 87 | summary: commit #3 |
|
88 | 88 | |
|
89 | 89 | SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++----------------------- |
|
90 | 90 | 1 files changed, 534 insertions(+), 534 deletions(-) |
|
91 | 91 | |
|
92 | 92 | |
|
93 | 93 | $ f -s .hg/store/data/*.d |
|
94 | 94 | .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=58616973 |
|
95 | 95 | $ hg debugrevlog * |
|
96 | 96 | format : 1 |
|
97 | 97 | flags : generaldelta |
|
98 | 98 | |
|
99 | 99 | revisions : 5001 |
|
100 | 100 | merges : 625 (12.50%) |
|
101 | 101 | normal : 4376 (87.50%) |
|
102 | 102 | revisions : 5001 |
|
103 | 103 | empty : 0 ( 0.00%) |
|
104 | 104 | text : 0 (100.00%) |
|
105 | 105 | delta : 0 (100.00%) |
|
106 | 106 | snapshot : 383 ( 7.66%) |
|
107 | 107 | lvl-0 : 3 ( 0.06%) |
|
108 | 108 | lvl-1 : 18 ( 0.36%) |
|
109 | 109 | lvl-2 : 62 ( 1.24%) |
|
110 | 110 | lvl-3 : 108 ( 2.16%) |
|
111 | 111 | lvl-4 : 191 ( 3.82%) |
|
112 | 112 | lvl-5 : 1 ( 0.02%) |
|
113 | 113 | deltas : 4618 (92.34%) |
|
114 | 114 | revision size : 58616973 |
|
115 | 115 | snapshot : 9247844 (15.78%) |
|
116 | 116 | lvl-0 : 539532 ( 0.92%) |
|
117 | 117 | lvl-1 : 1467743 ( 2.50%) |
|
118 | 118 | lvl-2 : 1873820 ( 3.20%) |
|
119 | 119 | lvl-3 : 2326874 ( 3.97%) |
|
120 | 120 | lvl-4 : 3029118 ( 5.17%) |
|
121 | 121 | lvl-5 : 10757 ( 0.02%) |
|
122 | 122 | deltas : 49369129 (84.22%) |
|
123 | 123 | |
|
124 | 124 | chunks : 5001 |
|
125 | 125 | 0x28 : 5001 (100.00%) |
|
126 | 126 | chunks size : 58616973 |
|
127 | 127 | 0x28 : 58616973 (100.00%) |
|
128 | 128 | |
|
129 | 129 | avg chain length : 9 |
|
130 | 130 | max chain length : 15 |
|
131 | 131 | max chain reach : 27366701 |
|
132 | 132 | compression ratio : 29 |
|
133 | 133 | |
|
134 | 134 | uncompressed data size (min/max/avg) : 346468 / 346472 / 346471 |
|
135 | 135 | full revision size (min/max/avg) : 179288 / 180786 / 179844 |
|
136 | 136 | inter-snapshot size (min/max/avg) : 10757 / 169507 / 22916 |
|
137 | 137 | level-1 (min/max/avg) : 13905 / 169507 / 81541 |
|
138 | 138 | level-2 (min/max/avg) : 10887 / 83873 / 30222 |
|
139 | 139 | level-3 (min/max/avg) : 10911 / 43047 / 21545 |
|
140 | 140 | level-4 (min/max/avg) : 10838 / 21390 / 15859 |
|
141 | 141 | level-5 (min/max/avg) : 10757 / 10757 / 10757 |
|
142 | 142 | delta size (min/max/avg) : 9672 / 108072 / 10690 |
|
143 | 143 | |
|
144 | 144 | deltas against prev : 3906 (84.58%) |
|
145 | 145 | where prev = p1 : 3906 (100.00%) |
|
146 | 146 | where prev = p2 : 0 ( 0.00%) |
|
147 | 147 | other : 0 ( 0.00%) |
|
148 | 148 | deltas against p1 : 649 (14.05%) |
|
149 | 149 | deltas against p2 : 63 ( 1.36%) |
|
150 | 150 | deltas against other : 0 ( 0.00%) |
|
151 | 151 | |
|
152 | 152 | |
|
153 | 153 | Test `debug-delta-find` |
|
154 | 154 | ----------------------- |
|
155 | 155 | |
|
156 | 156 | $ ls -1 |
|
157 | 157 | SPARSE-REVLOG-TEST-FILE |
|
158 |
$ hg debugdeltachain SPARSE-REVLOG-TEST-FILE | grep |
|
|
159 |
4971 3 5 4930 |
|
|
158 | $ hg debugdeltachain SPARSE-REVLOG-TEST-FILE | grep snap | tail -1 | |
|
159 | 4971 4970 -1 3 5 4930 snap 19179 346472 427596 1.23414 15994877 15567281 36.40652 427596 179288 1.00000 5 | |
|
160 | 160 | $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 |
|
161 | 161 | DBG-DELTAS-SEARCH: SEARCH rev=4971 |
|
162 | 162 | DBG-DELTAS-SEARCH: ROUND #1 - 2 candidates - search-down |
|
163 | 163 | DBG-DELTAS-SEARCH: CANDIDATE: rev=4962 |
|
164 | 164 | DBG-DELTAS-SEARCH: type=snapshot-4 |
|
165 | 165 | DBG-DELTAS-SEARCH: size=18296 |
|
166 | 166 | DBG-DELTAS-SEARCH: base=4930 |
|
167 | 167 | DBG-DELTAS-SEARCH: uncompressed-delta-size=30377 |
|
168 | 168 | DBG-DELTAS-SEARCH: delta-search-time=* (glob) |
|
169 | 169 | DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD) |
|
170 | 170 | DBG-DELTAS-SEARCH: CANDIDATE: rev=4971 |
|
171 | 171 | DBG-DELTAS-SEARCH: type=snapshot-4 |
|
172 | 172 | DBG-DELTAS-SEARCH: size=19179 |
|
173 | 173 | DBG-DELTAS-SEARCH: base=4930 |
|
174 | 174 | DBG-DELTAS-SEARCH: TOO-HIGH |
|
175 | 175 | DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down |
|
176 | 176 | DBG-DELTAS-SEARCH: CANDIDATE: rev=4930 |
|
177 | 177 | DBG-DELTAS-SEARCH: type=snapshot-3 |
|
178 | 178 | DBG-DELTAS-SEARCH: size=39228 |
|
179 | 179 | DBG-DELTAS-SEARCH: base=4799 |
|
180 | 180 | DBG-DELTAS-SEARCH: uncompressed-delta-size=33050 |
|
181 | 181 | DBG-DELTAS-SEARCH: delta-search-time=* (glob) |
|
182 | 182 | DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD) |
|
183 | 183 | DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down |
|
184 | 184 | DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179 |
|
185 | 185 | DBG-DELTAS-SEARCH: CANDIDATE: rev=4799 |
|
186 | 186 | DBG-DELTAS-SEARCH: type=snapshot-2 |
|
187 | 187 | DBG-DELTAS-SEARCH: size=50213 |
|
188 | 188 | DBG-DELTAS-SEARCH: base=4623 |
|
189 | 189 | DBG-DELTAS-SEARCH: uncompressed-delta-size=82661 |
|
190 | 190 | DBG-DELTAS-SEARCH: delta-search-time=* (glob) |
|
191 | 191 | DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD) |
|
192 | 192 | DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob) |
|
193 | 193 | |
|
194 | 194 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now