Show More
@@ -1,333 +1,362 b'' | |||||
1 | ========================================================== |
|
1 | ========================================================== | |
2 | Test various things around delta computation within revlog |
|
2 | Test various things around delta computation within revlog | |
3 | ========================================================== |
|
3 | ========================================================== | |
4 |
|
4 | |||
5 |
|
5 | |||
6 | basic setup |
|
6 | basic setup | |
7 | ----------- |
|
7 | ----------- | |
8 |
|
8 | |||
9 | $ cat << EOF >> $HGRCPATH |
|
9 | $ cat << EOF >> $HGRCPATH | |
10 | > [debug] |
|
10 | > [debug] | |
11 | > revlog.debug-delta=yes |
|
11 | > revlog.debug-delta=yes | |
12 | > EOF |
|
12 | > EOF | |
13 | $ cat << EOF >> sha256line.py |
|
13 | $ cat << EOF >> sha256line.py | |
14 | > # a way to quickly produce file of significant size and poorly compressable content. |
|
14 | > # a way to quickly produce file of significant size and poorly compressable content. | |
15 | > import hashlib |
|
15 | > import hashlib | |
16 | > import sys |
|
16 | > import sys | |
17 | > for line in sys.stdin: |
|
17 | > for line in sys.stdin: | |
18 | > print(hashlib.sha256(line.encode('utf8')).hexdigest()) |
|
18 | > print(hashlib.sha256(line.encode('utf8')).hexdigest()) | |
19 | > EOF |
|
19 | > EOF | |
20 |
|
20 | |||
21 | $ hg init base-repo |
|
21 | $ hg init base-repo | |
22 | $ cd base-repo |
|
22 | $ cd base-repo | |
23 |
|
23 | |||
24 | create a "large" file |
|
24 | create a "large" file | |
25 |
|
25 | |||
26 | $ $TESTDIR/seq.py 1000 | $PYTHON $TESTTMP/sha256line.py > my-file.txt |
|
26 | $ $TESTDIR/seq.py 1000 | $PYTHON $TESTTMP/sha256line.py > my-file.txt | |
27 | $ hg add my-file.txt |
|
27 | $ hg add my-file.txt | |
28 | $ hg commit -m initial-commit |
|
28 | $ hg commit -m initial-commit | |
29 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) |
|
29 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) | |
30 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
30 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
31 | DBG-DELTAS: CHANGELOG: * (glob) |
|
31 | DBG-DELTAS: CHANGELOG: * (glob) | |
32 |
|
32 | |||
33 | Add more change at the end of the file |
|
33 | Add more change at the end of the file | |
34 |
|
34 | |||
35 | $ $TESTDIR/seq.py 1001 1200 | $PYTHON $TESTTMP/sha256line.py >> my-file.txt |
|
35 | $ $TESTDIR/seq.py 1001 1200 | $PYTHON $TESTTMP/sha256line.py >> my-file.txt | |
36 | $ hg commit -m "large-change" |
|
36 | $ hg commit -m "large-change" | |
37 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) |
|
37 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) | |
38 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
38 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
39 | DBG-DELTAS: CHANGELOG: * (glob) |
|
39 | DBG-DELTAS: CHANGELOG: * (glob) | |
40 |
|
40 | |||
41 | Add small change at the start |
|
41 | Add small change at the start | |
42 |
|
42 | |||
43 | $ hg up 'desc("initial-commit")' --quiet |
|
43 | $ hg up 'desc("initial-commit")' --quiet | |
44 | $ mv my-file.txt foo |
|
44 | $ mv my-file.txt foo | |
45 | $ echo "small change at the start" > my-file.txt |
|
45 | $ echo "small change at the start" > my-file.txt | |
46 | $ cat foo >> my-file.txt |
|
46 | $ cat foo >> my-file.txt | |
47 | $ rm foo |
|
47 | $ rm foo | |
48 | $ hg commit -m "small-change" |
|
48 | $ hg commit -m "small-change" | |
49 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) |
|
49 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) | |
50 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
50 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
51 | DBG-DELTAS: CHANGELOG: * (glob) |
|
51 | DBG-DELTAS: CHANGELOG: * (glob) | |
52 | created new head |
|
52 | created new head | |
53 |
|
53 | |||
54 |
|
54 | |||
55 | $ hg log -r 'head()' -T '{node}\n' >> ../base-heads.nodes |
|
55 | $ hg log -r 'head()' -T '{node}\n' >> ../base-heads.nodes | |
56 | $ hg log -r 'desc("initial-commit")' -T '{node}\n' >> ../initial.node |
|
56 | $ hg log -r 'desc("initial-commit")' -T '{node}\n' >> ../initial.node | |
57 | $ hg log -r 'desc("small-change")' -T '{node}\n' >> ../small.node |
|
57 | $ hg log -r 'desc("small-change")' -T '{node}\n' >> ../small.node | |
58 | $ hg log -r 'desc("large-change")' -T '{node}\n' >> ../large.node |
|
58 | $ hg log -r 'desc("large-change")' -T '{node}\n' >> ../large.node | |
59 | $ cd .. |
|
59 | $ cd .. | |
60 |
|
60 | |||
61 | Check delta find policy and result for merge on commit |
|
61 | Check delta find policy and result for merge on commit | |
62 | ====================================================== |
|
62 | ====================================================== | |
63 |
|
63 | |||
64 | Check that delta of merge pick best of the two parents |
|
64 | Check that delta of merge pick best of the two parents | |
65 | ------------------------------------------------------ |
|
65 | ------------------------------------------------------ | |
66 |
|
66 | |||
67 | As we check against both parents, the one with the largest change should |
|
67 | As we check against both parents, the one with the largest change should | |
68 | produce the smallest delta and be picked. |
|
68 | produce the smallest delta and be picked. | |
69 |
|
69 | |||
70 | $ hg clone base-repo test-parents --quiet |
|
70 | $ hg clone base-repo test-parents --quiet | |
71 | $ hg -R test-parents update 'nodefromfile("small.node")' --quiet |
|
71 | $ hg -R test-parents update 'nodefromfile("small.node")' --quiet | |
72 | $ hg -R test-parents merge 'nodefromfile("large.node")' --quiet |
|
72 | $ hg -R test-parents merge 'nodefromfile("large.node")' --quiet | |
73 |
|
73 | |||
74 | The delta base is the "large" revision as it produce a smaller delta. |
|
74 | The delta base is the "large" revision as it produce a smaller delta. | |
75 |
|
75 | |||
76 | $ hg -R test-parents commit -m "merge from small change" |
|
76 | $ hg -R test-parents commit -m "merge from small change" | |
77 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob) |
|
77 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob) | |
78 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
78 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
79 | DBG-DELTAS: CHANGELOG: * (glob) |
|
79 | DBG-DELTAS: CHANGELOG: * (glob) | |
80 |
|
80 | |||
81 | Check that the behavior tested above can we disabled |
|
81 | Check that the behavior tested above can we disabled | |
82 | ---------------------------------------------------- |
|
82 | ---------------------------------------------------- | |
83 |
|
83 | |||
84 | We disable the checking of both parent at the same time. The `small` change, |
|
84 | We disable the checking of both parent at the same time. The `small` change, | |
85 | that produce a less optimal delta, should be picked first as it is "closer" to |
|
85 | that produce a less optimal delta, should be picked first as it is "closer" to | |
86 | the new commit. |
|
86 | the new commit. | |
87 |
|
87 | |||
88 | $ hg clone base-repo test-no-parents --quiet |
|
88 | $ hg clone base-repo test-no-parents --quiet | |
89 | $ hg -R test-no-parents update 'nodefromfile("small.node")' --quiet |
|
89 | $ hg -R test-no-parents update 'nodefromfile("small.node")' --quiet | |
90 | $ hg -R test-no-parents merge 'nodefromfile("large.node")' --quiet |
|
90 | $ hg -R test-no-parents merge 'nodefromfile("large.node")' --quiet | |
91 |
|
91 | |||
92 | The delta base is the "large" revision as it produce a smaller delta. |
|
92 | The delta base is the "large" revision as it produce a smaller delta. | |
93 |
|
93 | |||
94 | $ hg -R test-no-parents commit -m "merge from small change" \ |
|
94 | $ hg -R test-no-parents commit -m "merge from small change" \ | |
95 | > --config storage.revlog.optimize-delta-parent-choice=no |
|
95 | > --config storage.revlog.optimize-delta-parent-choice=no | |
96 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |
|
96 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
97 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
97 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
98 | DBG-DELTAS: CHANGELOG: * (glob) |
|
98 | DBG-DELTAS: CHANGELOG: * (glob) | |
99 |
|
99 | |||
100 |
|
100 | |||
101 | Check delta-find policy and result when unbundling |
|
101 | Check delta-find policy and result when unbundling | |
102 | ================================================== |
|
102 | ================================================== | |
103 |
|
103 | |||
104 | Build a bundle with all delta built against p1 |
|
104 | Build a bundle with all delta built against p1 | |
105 |
|
105 | |||
106 | $ hg bundle -R test-parents --all --config devel.bundle.delta=p1 all-p1.hg |
|
106 | $ hg bundle -R test-parents --all --config devel.bundle.delta=p1 all-p1.hg | |
107 | 4 changesets found |
|
107 | 4 changesets found | |
108 |
|
108 | |||
109 | Default policy of trusting delta from the bundle |
|
109 | Default policy of trusting delta from the bundle | |
110 | ------------------------------------------------ |
|
110 | ------------------------------------------------ | |
111 |
|
111 | |||
112 | Keeping the `p1` delta used in the bundle is sub-optimal for storage, but |
|
112 | Keeping the `p1` delta used in the bundle is sub-optimal for storage, but | |
113 | strusting in-bundle delta is faster to apply. |
|
113 | strusting in-bundle delta is faster to apply. | |
114 |
|
114 | |||
115 | $ hg init bundle-default |
|
115 | $ hg init bundle-default | |
116 | $ hg -R bundle-default unbundle all-p1.hg --quiet |
|
116 | $ hg -R bundle-default unbundle all-p1.hg --quiet | |
117 | DBG-DELTAS: CHANGELOG: * (glob) |
|
117 | DBG-DELTAS: CHANGELOG: * (glob) | |
118 | DBG-DELTAS: CHANGELOG: * (glob) |
|
118 | DBG-DELTAS: CHANGELOG: * (glob) | |
119 | DBG-DELTAS: CHANGELOG: * (glob) |
|
119 | DBG-DELTAS: CHANGELOG: * (glob) | |
120 | DBG-DELTAS: CHANGELOG: * (glob) |
|
120 | DBG-DELTAS: CHANGELOG: * (glob) | |
121 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
121 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
122 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
122 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
123 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
123 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
124 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
124 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
125 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) |
|
125 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) | |
126 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) |
|
126 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) | |
127 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) |
|
127 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) | |
128 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |
|
128 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
129 |
|
129 | |||
130 | (confirm the file revision are in the same order, 2 should be smaller than 1) |
|
130 | (confirm the file revision are in the same order, 2 should be smaller than 1) | |
131 |
|
131 | |||
132 | $ hg -R bundle-default debugdata my-file.txt 2 | wc -l |
|
132 | $ hg -R bundle-default debugdata my-file.txt 2 | wc -l | |
133 | \s*1001 (re) |
|
133 | \s*1001 (re) | |
134 | $ hg -R bundle-default debugdata my-file.txt 1 | wc -l |
|
134 | $ hg -R bundle-default debugdata my-file.txt 1 | wc -l | |
135 | \s*1200 (re) |
|
135 | \s*1200 (re) | |
136 |
|
136 | |||
137 | explicitly enabled |
|
137 | explicitly enabled | |
138 | ------------------ |
|
138 | ------------------ | |
139 |
|
139 | |||
140 | Keeping the `p1` delta used in the bundle is sub-optimal for storage, but |
|
140 | Keeping the `p1` delta used in the bundle is sub-optimal for storage, but | |
141 | strusting in-bundle delta is faster to apply. |
|
141 | strusting in-bundle delta is faster to apply. | |
142 |
|
142 | |||
143 | $ hg init bundle-reuse-enabled |
|
143 | $ hg init bundle-reuse-enabled | |
144 | $ hg -R bundle-reuse-enabled unbundle all-p1.hg --quiet \ |
|
144 | $ hg -R bundle-reuse-enabled unbundle all-p1.hg --quiet \ | |
145 | > --config storage.revlog.reuse-external-delta-parent=yes |
|
145 | > --config storage.revlog.reuse-external-delta-parent=yes | |
146 | DBG-DELTAS: CHANGELOG: * (glob) |
|
146 | DBG-DELTAS: CHANGELOG: * (glob) | |
147 | DBG-DELTAS: CHANGELOG: * (glob) |
|
147 | DBG-DELTAS: CHANGELOG: * (glob) | |
148 | DBG-DELTAS: CHANGELOG: * (glob) |
|
148 | DBG-DELTAS: CHANGELOG: * (glob) | |
149 | DBG-DELTAS: CHANGELOG: * (glob) |
|
149 | DBG-DELTAS: CHANGELOG: * (glob) | |
150 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
150 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
151 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
151 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
152 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
152 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
153 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
153 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
154 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) |
|
154 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) | |
155 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) |
|
155 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) | |
156 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) |
|
156 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) | |
157 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |
|
157 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
158 |
|
158 | |||
159 | (confirm the file revision are in the same order, 2 should be smaller than 1) |
|
159 | (confirm the file revision are in the same order, 2 should be smaller than 1) | |
160 |
|
160 | |||
161 | $ hg -R bundle-reuse-enabled debugdata my-file.txt 2 | wc -l |
|
161 | $ hg -R bundle-reuse-enabled debugdata my-file.txt 2 | wc -l | |
162 | \s*1001 (re) |
|
162 | \s*1001 (re) | |
163 | $ hg -R bundle-reuse-enabled debugdata my-file.txt 1 | wc -l |
|
163 | $ hg -R bundle-reuse-enabled debugdata my-file.txt 1 | wc -l | |
164 | \s*1200 (re) |
|
164 | \s*1200 (re) | |
165 |
|
165 | |||
166 | explicitly disabled |
|
166 | explicitly disabled | |
167 | ------------------- |
|
167 | ------------------- | |
168 |
|
168 | |||
169 | Not reusing the delta-base from the parent means we the delta will be made |
|
169 | Not reusing the delta-base from the parent means we the delta will be made | |
170 | against the "best" parent. (so not the same as the previous two) |
|
170 | against the "best" parent. (so not the same as the previous two) | |
171 |
|
171 | |||
172 | $ hg init bundle-reuse-disabled |
|
172 | $ hg init bundle-reuse-disabled | |
173 | $ hg -R bundle-reuse-disabled unbundle all-p1.hg --quiet \ |
|
173 | $ hg -R bundle-reuse-disabled unbundle all-p1.hg --quiet \ | |
174 | > --config storage.revlog.reuse-external-delta-parent=no |
|
174 | > --config storage.revlog.reuse-external-delta-parent=no | |
175 | DBG-DELTAS: CHANGELOG: * (glob) |
|
175 | DBG-DELTAS: CHANGELOG: * (glob) | |
176 | DBG-DELTAS: CHANGELOG: * (glob) |
|
176 | DBG-DELTAS: CHANGELOG: * (glob) | |
177 | DBG-DELTAS: CHANGELOG: * (glob) |
|
177 | DBG-DELTAS: CHANGELOG: * (glob) | |
178 | DBG-DELTAS: CHANGELOG: * (glob) |
|
178 | DBG-DELTAS: CHANGELOG: * (glob) | |
179 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
179 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
180 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
180 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
181 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
181 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
182 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
182 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
183 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) |
|
183 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) | |
184 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) |
|
184 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) | |
185 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) |
|
185 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) | |
186 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob) |
|
186 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob) | |
187 |
|
187 | |||
188 | (confirm the file revision are in the same order, 2 should be smaller than 1) |
|
188 | (confirm the file revision are in the same order, 2 should be smaller than 1) | |
189 |
|
189 | |||
190 | $ hg -R bundle-reuse-disabled debugdata my-file.txt 2 | wc -l |
|
190 | $ hg -R bundle-reuse-disabled debugdata my-file.txt 2 | wc -l | |
191 | \s*1001 (re) |
|
191 | \s*1001 (re) | |
192 | $ hg -R bundle-reuse-disabled debugdata my-file.txt 1 | wc -l |
|
192 | $ hg -R bundle-reuse-disabled debugdata my-file.txt 1 | wc -l | |
193 | \s*1200 (re) |
|
193 | \s*1200 (re) | |
194 |
|
194 | |||
195 |
|
195 | |||
196 | Check the path.*:pulled-delta-reuse-policy option |
|
196 | Check the path.*:pulled-delta-reuse-policy option | |
197 | ========================================== |
|
197 | ========================================== | |
198 |
|
198 | |||
199 | Get a repository with the bad parent picked and a clone ready to pull the merge |
|
199 | Get a repository with the bad parent picked and a clone ready to pull the merge | |
200 |
|
200 | |||
201 | $ cp -ar bundle-reuse-enabled peer-bad-delta |
|
201 | $ cp -ar bundle-reuse-enabled peer-bad-delta | |
202 | $ hg clone peer-bad-delta local-pre-pull --rev `cat large.node` --rev `cat small.node` --quiet |
|
202 | $ hg clone peer-bad-delta local-pre-pull --rev `cat large.node` --rev `cat small.node` --quiet | |
203 | DBG-DELTAS: CHANGELOG: * (glob) |
|
203 | DBG-DELTAS: CHANGELOG: * (glob) | |
204 | DBG-DELTAS: CHANGELOG: * (glob) |
|
204 | DBG-DELTAS: CHANGELOG: * (glob) | |
205 | DBG-DELTAS: CHANGELOG: * (glob) |
|
205 | DBG-DELTAS: CHANGELOG: * (glob) | |
206 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
206 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
207 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
207 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
208 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
208 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
209 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) |
|
209 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) | |
210 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) |
|
210 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) | |
211 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) |
|
211 | DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) | |
212 |
|
212 | |||
213 | Check the parent order for the file |
|
213 | Check the parent order for the file | |
214 |
|
214 | |||
215 | $ hg -R local-pre-pull debugdata my-file.txt 2 | wc -l |
|
215 | $ hg -R local-pre-pull debugdata my-file.txt 2 | wc -l | |
216 | \s*1001 (re) |
|
216 | \s*1001 (re) | |
217 | $ hg -R local-pre-pull debugdata my-file.txt 1 | wc -l |
|
217 | $ hg -R local-pre-pull debugdata my-file.txt 1 | wc -l | |
218 | \s*1200 (re) |
|
218 | \s*1200 (re) | |
219 |
|
219 | |||
220 | Pull with no value (so the default) |
|
220 | Pull with no value (so the default) | |
221 | ----------------------------------- |
|
221 | ----------------------------------- | |
222 |
|
222 | |||
223 | default is to reuse the (bad) delta |
|
223 | default is to reuse the (bad) delta | |
224 |
|
224 | |||
225 | $ cp -ar local-pre-pull local-no-value |
|
225 | $ cp -ar local-pre-pull local-no-value | |
226 | $ hg -R local-no-value pull --quiet |
|
226 | $ hg -R local-no-value pull --quiet | |
227 | DBG-DELTAS: CHANGELOG: * (glob) |
|
227 | DBG-DELTAS: CHANGELOG: * (glob) | |
228 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
228 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
229 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |
|
229 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
230 |
|
230 | |||
231 | Pull with explicitly the default |
|
231 | Pull with explicitly the default | |
232 | -------------------------------- |
|
232 | -------------------------------- | |
233 |
|
233 | |||
234 | default is to reuse the (bad) delta |
|
234 | default is to reuse the (bad) delta | |
235 |
|
235 | |||
236 | $ cp -ar local-pre-pull local-default |
|
236 | $ cp -ar local-pre-pull local-default | |
237 | $ hg -R local-default pull --quiet --config 'paths.default:pulled-delta-reuse-policy=default' |
|
237 | $ hg -R local-default pull --quiet --config 'paths.default:pulled-delta-reuse-policy=default' | |
238 | DBG-DELTAS: CHANGELOG: * (glob) |
|
238 | DBG-DELTAS: CHANGELOG: * (glob) | |
239 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
239 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
240 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |
|
240 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
241 |
|
241 | |||
242 | Pull with no-reuse |
|
242 | Pull with no-reuse | |
243 | ------------------ |
|
243 | ------------------ | |
244 |
|
244 | |||
245 | We don't reuse the base, so we get a better delta |
|
245 | We don't reuse the base, so we get a better delta | |
246 |
|
246 | |||
247 | $ cp -ar local-pre-pull local-no-reuse |
|
247 | $ cp -ar local-pre-pull local-no-reuse | |
248 | $ hg -R local-no-reuse pull --quiet --config 'paths.default:pulled-delta-reuse-policy=no-reuse' |
|
248 | $ hg -R local-no-reuse pull --quiet --config 'paths.default:pulled-delta-reuse-policy=no-reuse' | |
249 | DBG-DELTAS: CHANGELOG: * (glob) |
|
249 | DBG-DELTAS: CHANGELOG: * (glob) | |
250 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
250 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
251 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob) |
|
251 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob) | |
252 |
|
252 | |||
253 | Pull with try-base |
|
253 | Pull with try-base | |
254 | ------------------ |
|
254 | ------------------ | |
255 |
|
255 | |||
256 | We requested to use the (bad) delta |
|
256 | We requested to use the (bad) delta | |
257 |
|
257 | |||
258 | $ cp -ar local-pre-pull local-try-base |
|
258 | $ cp -ar local-pre-pull local-try-base | |
259 | $ hg -R local-try-base pull --quiet --config 'paths.default:pulled-delta-reuse-policy=try-base' |
|
259 | $ hg -R local-try-base pull --quiet --config 'paths.default:pulled-delta-reuse-policy=try-base' | |
260 | DBG-DELTAS: CHANGELOG: * (glob) |
|
260 | DBG-DELTAS: CHANGELOG: * (glob) | |
261 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
261 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
262 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |
|
262 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
263 |
|
263 | |||
264 | Case where we force a "bad" delta to be applied |
|
264 | Case where we force a "bad" delta to be applied | |
265 | =============================================== |
|
265 | =============================================== | |
266 |
|
266 | |||
267 | We build a very different file content to force a full snapshot |
|
267 | We build a very different file content to force a full snapshot | |
268 |
|
268 | |||
269 | $ cp -ar peer-bad-delta peer-bad-delta-with-full |
|
269 | $ cp -ar peer-bad-delta peer-bad-delta-with-full | |
270 | $ cp -ar local-pre-pull local-pre-pull-full |
|
270 | $ cp -ar local-pre-pull local-pre-pull-full | |
271 | $ echo '[paths]' >> local-pre-pull-full/.hg/hgrc |
|
271 | $ echo '[paths]' >> local-pre-pull-full/.hg/hgrc | |
272 | $ echo 'default=../peer-bad-delta-with-full' >> local-pre-pull-full/.hg/hgrc |
|
272 | $ echo 'default=../peer-bad-delta-with-full' >> local-pre-pull-full/.hg/hgrc | |
273 |
|
273 | |||
274 | $ hg -R peer-bad-delta-with-full update 'desc("merge")' --quiet |
|
274 | $ hg -R peer-bad-delta-with-full update 'desc("merge")' --quiet | |
275 | $ ($TESTDIR/seq.py 2000 2100; $TESTDIR/seq.py 500 510; $TESTDIR/seq.py 3000 3050) \ |
|
275 | $ ($TESTDIR/seq.py 2000 2100; $TESTDIR/seq.py 500 510; $TESTDIR/seq.py 3000 3050) \ | |
276 | > | $PYTHON $TESTTMP/sha256line.py > peer-bad-delta-with-full/my-file.txt |
|
276 | > | $PYTHON $TESTTMP/sha256line.py > peer-bad-delta-with-full/my-file.txt | |
277 | $ hg -R peer-bad-delta-with-full commit -m 'trigger-full' |
|
277 | $ hg -R peer-bad-delta-with-full commit -m 'trigger-full' | |
278 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob) |
|
278 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob) | |
279 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
279 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
280 | DBG-DELTAS: CHANGELOG: * (glob) |
|
280 | DBG-DELTAS: CHANGELOG: * (glob) | |
281 |
|
281 | |||
282 | Check that "try-base" behavior challenge the delta |
|
282 | Check that "try-base" behavior challenge the delta | |
283 | -------------------------------------------------- |
|
283 | -------------------------------------------------- | |
284 |
|
284 | |||
285 | The bundling process creates a delta against the previous revision, however this |
|
285 | The bundling process creates a delta against the previous revision, however this | |
286 | is an invalid chain for the client, so it is not considered and we do a full |
|
286 | is an invalid chain for the client, so it is not considered and we do a full | |
287 | snapshot again. |
|
287 | snapshot again. | |
288 |
|
288 | |||
289 | $ cp -ar local-pre-pull-full local-try-base-full |
|
289 | $ cp -ar local-pre-pull-full local-try-base-full | |
290 | $ hg -R local-try-base-full pull --quiet \ |
|
290 | $ hg -R local-try-base-full pull --quiet \ | |
291 | > --config 'paths.default:pulled-delta-reuse-policy=try-base' |
|
291 | > --config 'paths.default:pulled-delta-reuse-policy=try-base' | |
292 | DBG-DELTAS: CHANGELOG: * (glob) |
|
292 | DBG-DELTAS: CHANGELOG: * (glob) | |
293 | DBG-DELTAS: CHANGELOG: * (glob) |
|
293 | DBG-DELTAS: CHANGELOG: * (glob) | |
294 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
294 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
295 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
295 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
296 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |
|
296 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
297 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob) |
|
297 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob) | |
298 |
|
298 | |||
299 | Check that "forced" behavior do not challenge the delta, even if it is full. |
|
299 | Check that "forced" behavior do not challenge the delta, even if it is full. | |
300 | --------------------------------------------------------------------------- |
|
300 | --------------------------------------------------------------------------- | |
301 |
|
301 | |||
302 | A full bundle should be accepted as full bundle without recomputation |
|
302 | A full bundle should be accepted as full bundle without recomputation | |
303 |
|
303 | |||
304 | $ cp -ar local-pre-pull-full local-forced-full |
|
304 | $ cp -ar local-pre-pull-full local-forced-full | |
305 | $ hg -R local-forced-full pull --quiet \ |
|
305 | $ hg -R local-forced-full pull --quiet \ | |
306 | > --config 'paths.default:pulled-delta-reuse-policy=forced' |
|
306 | > --config 'paths.default:pulled-delta-reuse-policy=forced' | |
307 | DBG-DELTAS: CHANGELOG: * (glob) |
|
307 | DBG-DELTAS: CHANGELOG: * (glob) | |
308 | DBG-DELTAS: CHANGELOG: * (glob) |
|
308 | DBG-DELTAS: CHANGELOG: * (glob) | |
309 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
309 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
310 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
310 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
311 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |
|
311 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
312 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - * (glob) |
|
312 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - * (glob) | |
313 |
|
313 | |||
314 | Check that "forced" behavior do not challenge the delta, even if it is bad. |
|
314 | Check that "forced" behavior do not challenge the delta, even if it is bad. | |
315 | --------------------------------------------------------------------------- |
|
315 | --------------------------------------------------------------------------- | |
316 |
|
316 | |||
317 | The client does not challenge anything and applies the bizarre delta directly. |
|
317 | The client does not challenge anything and applies the bizarre delta directly. | |
318 |
|
318 | |||
319 | Note: If the bundling process becomes smarter, this test might no longer work |
|
319 | Note: If the bundling process becomes smarter, this test might no longer work | |
320 | (as the server won't be sending "bad" deltas anymore) and might need something |
|
320 | (as the server won't be sending "bad" deltas anymore) and might need something | |
321 | more subtle to test this behavior. |
|
321 | more subtle to test this behavior. | |
322 |
|
322 | |||
323 | $ hg bundle -R peer-bad-delta-with-full --all --config devel.bundle.delta=p1 all-p1.hg |
|
323 | $ hg bundle -R peer-bad-delta-with-full --all --config devel.bundle.delta=p1 all-p1.hg | |
324 | 5 changesets found |
|
324 | 5 changesets found | |
325 | $ cp -ar local-pre-pull-full local-forced-full-p1 |
|
325 | $ cp -ar local-pre-pull-full local-forced-full-p1 | |
326 | $ hg -R local-forced-full-p1 pull --quiet \ |
|
326 | $ hg -R local-forced-full-p1 pull --quiet \ | |
327 | > --config 'paths.*:pulled-delta-reuse-policy=forced' all-p1.hg |
|
327 | > --config 'paths.*:pulled-delta-reuse-policy=forced' all-p1.hg | |
328 | DBG-DELTAS: CHANGELOG: * (glob) |
|
328 | DBG-DELTAS: CHANGELOG: * (glob) | |
329 | DBG-DELTAS: CHANGELOG: * (glob) |
|
329 | DBG-DELTAS: CHANGELOG: * (glob) | |
330 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
330 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
331 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
331 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
332 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |
|
332 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
333 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=3 * (glob) |
|
333 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=3 * (glob) | |
|
334 | ||||
|
335 | Check that running "forced" on a non-general delta repository does not corrupt it | |||
|
336 | --------------------------------------------------------------------------------- | |||
|
337 | ||||
|
338 | Even if requested to be used, some of the delta in the revlog cannot be stored on a non-general delta repository. We check that the bundle application was correct. | |||
|
339 | ||||
|
340 | $ hg init \ | |||
|
341 | > --config format.usegeneraldelta=no \ | |||
|
342 | > --config format.sparse-revlog=no \ | |||
|
343 | > local-forced-full-p1-no-gd | |||
|
344 | $ hg debugformat -R local-forced-full-p1-no-gd | grep generaldelta | |||
|
345 | generaldelta: no | |||
|
346 | $ hg -R local-forced-full-p1-no-gd pull --quiet local-pre-pull-full \ | |||
|
347 | > --config debug.revlog.debug-delta=no | |||
|
348 | $ hg -R local-forced-full-p1-no-gd pull --quiet \ | |||
|
349 | > --config 'paths.*:pulled-delta-reuse-policy=forced' all-p1.hg | |||
|
350 | DBG-DELTAS: CHANGELOG: * (glob) | |||
|
351 | DBG-DELTAS: CHANGELOG: * (glob) | |||
|
352 | DBG-DELTAS: MANIFESTLOG: * (glob) | |||
|
353 | DBG-DELTAS: MANIFESTLOG: * (glob) | |||
|
354 | DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=0 * - search-rounds=1 try-count=1 * (glob) | |||
|
355 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * - search-rounds=1 try-count=1 * (glob) | |||
|
356 | $ hg -R local-forced-full-p1-no-gd verify | |||
|
357 | checking changesets | |||
|
358 | checking manifests | |||
|
359 | crosschecking files in changesets and manifests | |||
|
360 | checking files | |||
|
361 | checking dirstate | |||
|
362 | checked 5 changesets with 5 changes to 1 files |
General Comments 0
You need to be logged in to leave comments.
Login now