Debian Codegraph @

tests/test-sparse-revlog-full.t

raw
1 ====================================
2 Test delta choice with sparse revlog
3 ====================================
4
5 #testcases delta-info-flags flagless
6
7
8 Common Setup
9 ============
10
11 #if pure
12 $ PURE="1"
13 #else
14 $ PURE="0"
15 #endif
16 #if slow
17 $ SLOW="1"
18 #else
19 $ SLOW="0"
20 #endif
21 #if delta-info-flags
22 $ DELTA_INFO="yes"
23 #else
24 $ DELTA_INFO="no"
25 #endif
26 $ export SLOW
27 $ export PURE
28 $ export DELTA_INFO
29 $ bash $TESTDIR/testlib/setup-sparse-churning-bundle.sh
30 adding changesets
31 adding manifests
32 adding file changes
33 added 5001 changesets with 5001 changes to 1 files (+89 heads)
34 new changesets 9706f5af64f4:3bb1647e55b4 (5001 drafts)
35 (run 'hg heads' to see heads, 'hg merge' to merge)
36 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 updated to "3bb1647e55b4: commit #5000"
38 89 other heads for branch "default"
39 $ if [ -f SKIPPED ]; then
40 > cat SKIPPED
41 > exit 80
42 > fi
43 $ cd sparse-repo
44
45 $ cat << EOF >>.hg/hgrc
46 > [storage]
47 > revlog.optimize-delta-parent-choice = yes
48 > revlog.reuse-external-delta = no
49 > EOF
50
51
52 Testing exchange through full bundle
53 ====================================
54
55 Pull of everything and check the quality of the result,
56
57 Doing a full pull should give use the same result as the pull source as the
58 server should be able to encode his chain as is.
59
60 $ hg init ../full-pull
61 $ cd ../full-pull
62
63 Here we go ove the default and trust parent choice from the bundle. Since all
64 revision are bundled, all delta base should be valid and the server should be
65 able to stream its delta as is.
66
67 $ cat << EOF >> .hg/hgrc
68 > [path]
69 > *:pulled-delta-reuse-policy = try-base
70 > EOF
71
72
73 pull everything
74
75 $ hg pull ../sparse-repo
76 pulling from ../sparse-repo
77 requesting all changes
78 adding changesets
79 adding manifests
80 adding file changes
81 added 5001 changesets with 5001 changes to 1 files (+89 heads)
82 new changesets 9706f5af64f4:3bb1647e55b4
83 (run 'hg heads' to see heads, 'hg merge' to merge)
84 $ hg up tip
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 $ cd ../
87 #if delta-info-flags
88 $ f -s */.hg/store/data/*.d
89 full-pull/.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=24793761
90 sparse-repo/.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=24793761
91 #else
92 $ f -s */.hg/store/data/*.d
93 full-pull/.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=28502223
94 sparse-repo/.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=28502223
95 #endif
96 $ hg debugrevlog --cwd full-pull SPARSE-REVLOG-TEST-FILE > ./revlog-stats-post-pull.txt
97 $ cmp ./revlog-stats-reference.txt ./revlog-stats-post-pull.txt | diff -u ./revlog-stats-reference.txt ./revlog-stats-post-pull.txt
98
99 $ cd ..