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