Mercurial > hg
comparison tests/test-revlog-delta-find.t @ 49767:f1887500f3ec
delta-find: add a `delta-reuse-policy` on configuration `path`
That option allows to control the behavior on a per-path basis, opening the way
to treating pulls from central servers differently than other operations.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 03 Dec 2022 01:24:34 +0100 |
parents | e300f445ca77 |
children | bcae90c53def |
comparison
equal
deleted
inserted
replaced
49766:152d9c011bcd | 49767:f1887500f3ec |
---|---|
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 | |
195 | |
196 Check the path.*:delta-reuse-policy option | |
197 ========================================== | |
198 | |
199 Get a repository with the bad parent picked and a clone ready to pull the merge | |
200 | |
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 | |
203 DBG-DELTAS: CHANGELOG: * (glob) | |
204 DBG-DELTAS: CHANGELOG: * (glob) | |
205 DBG-DELTAS: CHANGELOG: * (glob) | |
206 DBG-DELTAS: MANIFESTLOG: * (glob) | |
207 DBG-DELTAS: MANIFESTLOG: * (glob) | |
208 DBG-DELTAS: MANIFESTLOG: * (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) | |
211 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob) | |
212 | |
213 Check the parent order for the file | |
214 | |
215 $ hg -R local-pre-pull debugdata my-file.txt 2 | wc -l | |
216 \s*1001 (re) | |
217 $ hg -R local-pre-pull debugdata my-file.txt 1 | wc -l | |
218 \s*1200 (re) | |
219 | |
220 Pull with no value (so the default) | |
221 ----------------------------------- | |
222 | |
223 default is to reuse the (bad) delta | |
224 | |
225 $ cp -ar local-pre-pull local-no-value | |
226 $ hg -R local-no-value pull --quiet | |
227 DBG-DELTAS: CHANGELOG: * (glob) | |
228 DBG-DELTAS: MANIFESTLOG: * (glob) | |
229 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
230 | |
231 Pull with explicitly the default | |
232 -------------------------------- | |
233 | |
234 default is to reuse the (bad) delta | |
235 | |
236 $ cp -ar local-pre-pull local-default | |
237 $ hg -R local-default pull --quiet --config 'paths.default:delta-reuse-policy=default' | |
238 DBG-DELTAS: CHANGELOG: * (glob) | |
239 DBG-DELTAS: MANIFESTLOG: * (glob) | |
240 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) | |
241 | |
242 Pull with no-reuse | |
243 ------------------ | |
244 | |
245 We don't reuse the base, so we get a better delta | |
246 | |
247 $ cp -ar local-pre-pull local-no-reuse | |
248 $ hg -R local-no-reuse pull --quiet --config 'paths.default:delta-reuse-policy=no-reuse' | |
249 DBG-DELTAS: CHANGELOG: * (glob) | |
250 DBG-DELTAS: MANIFESTLOG: * (glob) | |
251 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob) | |
252 | |
253 Pull with try-base | |
254 ------------------ | |
255 | |
256 We requested to use the (bad) delta | |
257 | |
258 $ cp -ar local-pre-pull local-try-base | |
259 $ hg -R local-try-base pull --quiet --config 'paths.default:delta-reuse-policy=try-base' | |
260 DBG-DELTAS: CHANGELOG: * (glob) | |
261 DBG-DELTAS: MANIFESTLOG: * (glob) | |
262 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob) |