|
1 ==================================== |
|
2 Test delta choice with sparse revlog |
|
3 ==================================== |
|
4 |
|
5 Sparse-revlog usually shows the most gain on Manifest. However, it is simpler |
|
6 to general an appropriate file, so we test with a single file instead. The |
|
7 goal is to observe intermediate snapshot being created. |
|
8 |
|
9 We need a large enough file. Part of the content needs to be replaced |
|
10 repeatedly while some of it changes rarely. |
|
11 |
|
12 $ bundlepath="$TESTDIR/artifacts/cache/big-file-churn.hg" |
|
13 |
|
14 $ expectedhash=`cat "$bundlepath".md5` |
|
15 $ if [ ! -f "$bundlepath" ]; then |
|
16 > echo 'skipped: missing artifact, run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"' |
|
17 > exit 80 |
|
18 > fi |
|
19 $ currenthash=`f -M "$bundlepath" | cut -d = -f 2` |
|
20 $ if [ "$currenthash" != "$expectedhash" ]; then |
|
21 > echo 'skipped: outdated artifact, md5 "'"$currenthash"'" expected "'"$expectedhash"'" run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"' |
|
22 > exit 80 |
|
23 > fi |
|
24 |
|
25 $ cat >> $HGRCPATH << EOF |
|
26 > [format] |
|
27 > sparse-revlog = yes |
|
28 > [storage] |
|
29 > revlog.optimize-delta-parent-choice = yes |
|
30 > EOF |
|
31 $ hg init sparse-repo |
|
32 $ cd sparse-repo |
|
33 $ hg unbundle $bundlepath |
|
34 adding changesets |
|
35 adding manifests |
|
36 adding file changes |
|
37 added 5001 changesets with 5001 changes to 1 files (+89 heads) |
|
38 new changesets 9706f5af64f4:d9032adc8114 (5001 drafts) |
|
39 (run 'hg heads' to see heads, 'hg merge' to merge) |
|
40 $ hg up |
|
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
42 updated to "d9032adc8114: commit #5000" |
|
43 89 other heads for branch "default" |
|
44 |
|
45 $ hg log --stat -r 0:3 |
|
46 changeset: 0:9706f5af64f4 |
|
47 user: test |
|
48 date: Thu Jan 01 00:00:00 1970 +0000 |
|
49 summary: initial commit |
|
50 |
|
51 SPARSE-REVLOG-TEST-FILE | 10500 ++++++++++++++++++++++++++++++++++++++++++++++ |
|
52 1 files changed, 10500 insertions(+), 0 deletions(-) |
|
53 |
|
54 changeset: 1:724907deaa5e |
|
55 user: test |
|
56 date: Thu Jan 01 00:00:00 1970 +0000 |
|
57 summary: commit #1 |
|
58 |
|
59 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++----------------------- |
|
60 1 files changed, 534 insertions(+), 534 deletions(-) |
|
61 |
|
62 changeset: 2:62c41bce3e5d |
|
63 user: test |
|
64 date: Thu Jan 01 00:00:00 1970 +0000 |
|
65 summary: commit #2 |
|
66 |
|
67 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++----------------------- |
|
68 1 files changed, 534 insertions(+), 534 deletions(-) |
|
69 |
|
70 changeset: 3:348a9cbd6959 |
|
71 user: test |
|
72 date: Thu Jan 01 00:00:00 1970 +0000 |
|
73 summary: commit #3 |
|
74 |
|
75 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++----------------------- |
|
76 1 files changed, 534 insertions(+), 534 deletions(-) |
|
77 |
|
78 |
|
79 $ f -s .hg/store/data/*.d |
|
80 .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=74365490 |
|
81 $ hg debugrevlog * |
|
82 format : 1 |
|
83 flags : generaldelta |
|
84 |
|
85 revisions : 5001 |
|
86 merges : 625 (12.50%) |
|
87 normal : 4376 (87.50%) |
|
88 revisions : 5001 |
|
89 empty : 0 ( 0.00%) |
|
90 text : 0 (100.00%) |
|
91 delta : 0 (100.00%) |
|
92 snapshot : 101 ( 2.02%) |
|
93 lvl-0 : 101 ( 2.02%) |
|
94 deltas : 4900 (97.98%) |
|
95 revision size : 74365490 |
|
96 snapshot : 20307865 (27.31%) |
|
97 lvl-0 : 20307865 (27.31%) |
|
98 deltas : 54057625 (72.69%) |
|
99 |
|
100 chunks : 5001 |
|
101 0x78 (x) : 5001 (100.00%) |
|
102 chunks size : 74365490 |
|
103 0x78 (x) : 74365490 (100.00%) |
|
104 |
|
105 avg chain length : 23 |
|
106 max chain length : 45 |
|
107 max chain reach : 11039464 |
|
108 compression ratio : 23 |
|
109 |
|
110 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471 |
|
111 full revision size (min/max/avg) : 200927 / 201202 / 201067 |
|
112 inter-snapshot size (min/max/avg) : 0 / 0 / 0 |
|
113 delta size (min/max/avg) : 10649 / 103898 / 11032 |
|
114 |
|
115 deltas against prev : 4231 (86.35%) |
|
116 where prev = p1 : 4172 (98.61%) |
|
117 where prev = p2 : 0 ( 0.00%) |
|
118 other : 59 ( 1.39%) |
|
119 deltas against p1 : 651 (13.29%) |
|
120 deltas against p2 : 18 ( 0.37%) |
|
121 deltas against other : 0 ( 0.00%) |