Show More
@@ -58,7 +58,6 b' Configs:' | |||
|
58 | 58 | ``remotefilelog.debug`` turn on remotefilelog-specific debug output |
|
59 | 59 | ``remotefilelog.excludepattern`` pattern of files to exclude from pulls |
|
60 | 60 | ``remotefilelog.includepattern``pattern of files to include in pulls |
|
61 | ``remotefilelog.fetchpacks`` if set, fetch pre-packed files from the server | |
|
62 | 61 | ``remotefilelog.fetchwarning``: message to print when too many |
|
63 | 62 | single-file fetches occur |
|
64 | 63 | ``remotefilelog.getfilesstep`` number of files to request in a single RPC |
@@ -153,7 +152,6 b" configitem('remotefilelog', 'cacheproces" | |||
|
153 | 152 | configitem('remotefilelog', 'cacheprocess.includepath', default=None) |
|
154 | 153 | configitem("remotefilelog", "cachelimit", default="1000 GB") |
|
155 | 154 | |
|
156 | configitem('remotefilelog', 'fetchpacks', default=False) | |
|
157 | 155 | configitem('remotefilelog', 'fallbackpath', default=configitems.dynamicdefault, |
|
158 | 156 | alias=[('remotefilelog', 'fallbackrepo')]) |
|
159 | 157 |
@@ -10,7 +10,6 b' from __future__ import absolute_import' | |||
|
10 | 10 | import hashlib |
|
11 | 11 | import io |
|
12 | 12 | import os |
|
13 | import struct | |
|
14 | 13 | import threading |
|
15 | 14 | import time |
|
16 | 15 | |
@@ -30,8 +29,6 b' from . import (' | |||
|
30 | 29 | contentstore, |
|
31 | 30 | lz4wrapper, |
|
32 | 31 | metadatastore, |
|
33 | shallowutil, | |
|
34 | wirepack, | |
|
35 | 32 | ) |
|
36 | 33 | |
|
37 | 34 | _sshv1peer = sshpeer.sshv1peer |
@@ -316,10 +313,6 b' class fileserverclient(object):' | |||
|
316 | 313 | cache = self.remotecache |
|
317 | 314 | writedata = self.writedata |
|
318 | 315 | |
|
319 | if self.ui.configbool('remotefilelog', 'fetchpacks'): | |
|
320 | self.requestpack(fileids) | |
|
321 | return | |
|
322 | ||
|
323 | 316 | repo = self.repo |
|
324 | 317 | count = len(fileids) |
|
325 | 318 | request = "get\n%d\n" % count |
@@ -453,61 +446,6 b' class fileserverclient(object):' | |||
|
453 | 446 | self.writedata.addremotefilelognode(filename, bin(node), |
|
454 | 447 | lz4wrapper.lz4decompress(data)) |
|
455 | 448 | |
|
456 | def requestpack(self, fileids): | |
|
457 | """Requests the given file revisions from the server in a pack format. | |
|
458 | ||
|
459 | See `remotefilelogserver.getpack` for the file format. | |
|
460 | """ | |
|
461 | try: | |
|
462 | with self._connect() as conn: | |
|
463 | total = len(fileids) | |
|
464 | rcvd = 0 | |
|
465 | ||
|
466 | remote = conn.peer | |
|
467 | remote._callstream("getpackv1") | |
|
468 | ||
|
469 | self._sendpackrequest(remote, fileids) | |
|
470 | ||
|
471 | packpath = shallowutil.getcachepackpath( | |
|
472 | self.repo, constants.FILEPACK_CATEGORY) | |
|
473 | pipei = remote._pipei | |
|
474 | receiveddata, receivedhistory = wirepack.receivepack( | |
|
475 | self.repo.ui, pipei, packpath) | |
|
476 | rcvd = len(receiveddata) | |
|
477 | ||
|
478 | self.ui.log("remotefilefetchlog", | |
|
479 | "Success(pack)\n" if (rcvd==total) else "Fail(pack)\n", | |
|
480 | fetched_files = rcvd, | |
|
481 | total_to_fetch = total) | |
|
482 | except Exception: | |
|
483 | self.ui.log("remotefilefetchlog", | |
|
484 | "Fail(pack)\n", | |
|
485 | fetched_files = rcvd, | |
|
486 | total_to_fetch = total) | |
|
487 | raise | |
|
488 | ||
|
489 | def _sendpackrequest(self, remote, fileids): | |
|
490 | """Formats and writes the given fileids to the remote as part of a | |
|
491 | getpackv1 call. | |
|
492 | """ | |
|
493 | # Sort the requests by name, so we receive requests in batches by name | |
|
494 | grouped = {} | |
|
495 | for filename, node in fileids: | |
|
496 | grouped.setdefault(filename, set()).add(node) | |
|
497 | ||
|
498 | # Issue request | |
|
499 | pipeo = remote._pipeo | |
|
500 | for filename, nodes in grouped.iteritems(): | |
|
501 | filenamelen = struct.pack(constants.FILENAMESTRUCT, len(filename)) | |
|
502 | countlen = struct.pack(constants.PACKREQUESTCOUNTSTRUCT, len(nodes)) | |
|
503 | rawnodes = ''.join(bin(n) for n in nodes) | |
|
504 | ||
|
505 | pipeo.write('%s%s%s%s' % (filenamelen, filename, countlen, | |
|
506 | rawnodes)) | |
|
507 | pipeo.flush() | |
|
508 | pipeo.write(struct.pack(constants.FILENAMESTRUCT, 0)) | |
|
509 | pipeo.flush() | |
|
510 | ||
|
511 | 449 | def connect(self): |
|
512 | 450 | if self.cacheprocess: |
|
513 | 451 | cmd = "%s %s" % (self.cacheprocess, self.writedata._path) |
@@ -118,9 +118,6 b' def makeunionstores(repo):' | |||
|
118 | 118 | |
|
119 | 119 | fileservicedatawrite = cachecontent |
|
120 | 120 | fileservicehistorywrite = cachemetadata |
|
121 | if repo.ui.configbool('remotefilelog', 'fetchpacks'): | |
|
122 | fileservicedatawrite = packcontentstore | |
|
123 | fileservicehistorywrite = packmetadatastore | |
|
124 | 121 | repo.fileservice.setstore(repo.contentstore, repo.metadatastore, |
|
125 | 122 | fileservicedatawrite, fileservicehistorywrite) |
|
126 | 123 | shallowutil.reportpackmetrics(repo.ui, 'filestore', |
@@ -201,66 +201,36 b'' | |||
|
201 | 201 | $ clearcache |
|
202 | 202 | $ hg addremove -s 50 > /dev/null |
|
203 | 203 | 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob) |
|
204 | ||
|
205 | $ cd .. | |
|
204 | $ hg revert --all | |
|
205 | forgetting x2 | |
|
206 | forgetting y2 | |
|
207 | forgetting z2 | |
|
208 | undeleting x | |
|
209 | undeleting y | |
|
210 | undeleting z | |
|
206 | 211 | |
|
207 | # Prefetch packs | |
|
208 | $ hgcloneshallow ssh://user@dummy/master packprefetch | |
|
209 | streaming all changes | |
|
210 | 2 files to transfer, 528 bytes of data | |
|
211 | transferred 528 bytes in * seconds (*/sec) (glob) | |
|
212 | searching for changes | |
|
213 | no changes found | |
|
214 | updating to branch default | |
|
215 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
216 | $ cd packprefetch | |
|
217 | $ cat >> .hg/hgrc <<EOF | |
|
218 | > [remotefilelog] | |
|
219 | > fetchpacks=True | |
|
220 | > backgroundrepack=True | |
|
221 | > EOF | |
|
222 | $ clearcache | |
|
223 | $ hg prefetch -r . | |
|
224 | 3 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob) | |
|
225 | $ find $TESTTMP/hgcache -type f | sort | |
|
226 | $TESTTMP/hgcache/master/packs/47d8f1b90a73af4ff8af19fcd10bdc027b6a881a.histidx | |
|
227 | $TESTTMP/hgcache/master/packs/47d8f1b90a73af4ff8af19fcd10bdc027b6a881a.histpack | |
|
228 | $TESTTMP/hgcache/master/packs/8c654541e4f20141a894bbfe428e36fc92202e39.dataidx | |
|
229 | $TESTTMP/hgcache/master/packs/8c654541e4f20141a894bbfe428e36fc92202e39.datapack | |
|
230 | $ hg cat -r . x | |
|
231 | x2 | |
|
232 | $ hg cat -r . y | |
|
233 | y | |
|
234 | $ hg cat -r . z | |
|
235 | z | |
|
236 | ||
|
237 | # Prefetch packs that include renames | |
|
238 | $ cd ../master | |
|
239 | $ hg mv z z2 | |
|
240 | $ hg commit -m 'move z -> z2' | |
|
241 | $ cd ../packprefetch | |
|
242 | $ hg pull -q | |
|
243 | (running background incremental repack) | |
|
244 | $ hg prefetch -r tip | |
|
245 | 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob) | |
|
246 | $ hg up tip -q | |
|
247 | $ hg log -f z2 -T '{desc}\n' | |
|
248 | move z -> z2 | |
|
249 | x | |
|
250 | 212 | |
|
251 | 213 | # Revert across double renames. Note: the scary "abort", error is because |
|
252 | 214 | # https://bz.mercurial-scm.org/5419 . |
|
253 | 215 | |
|
216 | $ cd ../master | |
|
217 | $ hg mv z z2 | |
|
218 | $ hg commit -m 'move z -> z2' | |
|
219 | $ cd ../shallow2 | |
|
220 | $ hg pull -q | |
|
254 | 221 | $ clearcache |
|
255 | 222 | $ hg mv y y2 |
|
223 | y2: not overwriting - file exists | |
|
224 | ('hg rename --after' to record the rename) | |
|
225 | [1] | |
|
256 | 226 | $ hg mv x x2 |
|
227 | x2: not overwriting - file exists | |
|
228 | ('hg rename --after' to record the rename) | |
|
229 | [1] | |
|
257 | 230 | $ hg mv z2 z3 |
|
231 | z2: not copying - file is not managed | |
|
232 | abort: no files to copy | |
|
233 | [255] | |
|
258 | 234 | $ hg revert -a -r 1 || true |
|
259 | forgetting x2 | |
|
260 | forgetting y2 | |
|
261 | forgetting z3 | |
|
262 | adding z | |
|
263 | undeleting x | |
|
264 | undeleting y | |
|
265 | 3 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob) | |
|
235 | 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob) | |
|
266 | 236 | abort: z2@109c3a557a73: not found in manifest! (?) |
@@ -285,53 +285,48 b' Incremental repack' | |||
|
285 | 285 | > [remotefilelog] |
|
286 | 286 | > data.generations=60 |
|
287 | 287 | > 150 |
|
288 | > fetchpacks=True | |
|
289 | 288 | > EOF |
|
290 | 289 | |
|
291 | 290 | Single pack - repack does nothing |
|
292 | 291 | $ hg prefetch -r 0 |
|
293 |
1 files fetched over 1 fetches - ( |
|
|
292 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
294 | 293 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
295 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
294 | [1] | |
|
296 | 295 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
297 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack | |
|
296 | [1] | |
|
298 | 297 | $ hg repack --incremental |
|
299 | 298 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
300 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
299 | -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack | |
|
301 | 300 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
302 | 301 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack |
|
303 | 302 | |
|
304 | 303 | 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1 |
|
305 | 304 | $ hg prefetch -r 1 |
|
306 |
1 files fetched over 1 fetches - ( |
|
|
305 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
307 | 306 | $ hg prefetch -r 2 |
|
308 |
1 files fetched over 1 fetches - ( |
|
|
307 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
309 | 308 | $ hg prefetch -r 3 |
|
310 |
1 files fetched over 1 fetches - ( |
|
|
309 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
311 | 310 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
312 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
313 | -r--r--r-- 65 6c499d21350d79f92fd556b4b7a902569d88e3c9.datapack | |
|
314 | -r--r--r-- 61 817d294043bd21a3de01f807721971abe45219ce.datapack | |
|
315 | -r--r--r-- 63 ff45add45ab3f59c4f75efc6a087d86c821219d6.datapack | |
|
311 | -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack | |
|
316 | 312 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
317 | -r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack | |
|
318 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack | |
|
319 | -r--r--r-- 172 276d308429d0303762befa376788300f0310f90e.histpack | |
|
320 | 313 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack |
|
321 | 314 | $ hg repack --incremental |
|
322 | 315 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
323 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
324 | 316 | -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack |
|
317 | -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack | |
|
325 | 318 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
326 | 319 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack |
|
320 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack | |
|
327 | 321 | |
|
328 | 322 | 1 gen3 pack, 1 gen0 pack - does nothing |
|
329 | 323 | $ hg repack --incremental |
|
330 | 324 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
331 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
332 | 325 | -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack |
|
326 | -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack | |
|
333 | 327 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
334 | 328 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack |
|
329 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack | |
|
335 | 330 | |
|
336 | 331 | Pull should run background repack |
|
337 | 332 | $ cat >> .hg/hgrc <<EOF |
@@ -340,23 +335,13 b' Pull should run background repack' | |||
|
340 | 335 | > EOF |
|
341 | 336 | $ clearcache |
|
342 | 337 | $ hg prefetch -r 0 |
|
343 |
1 files fetched over 1 fetches - ( |
|
|
338 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
344 | 339 | $ hg prefetch -r 1 |
|
345 |
1 files fetched over 1 fetches - ( |
|
|
340 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
346 | 341 | $ hg prefetch -r 2 |
|
347 |
1 files fetched over 1 fetches - ( |
|
|
342 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
348 | 343 | $ hg prefetch -r 3 |
|
349 |
1 files fetched over 1 fetches - ( |
|
|
350 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack | |
|
351 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
352 | -r--r--r-- 65 6c499d21350d79f92fd556b4b7a902569d88e3c9.datapack | |
|
353 | -r--r--r-- 61 817d294043bd21a3de01f807721971abe45219ce.datapack | |
|
354 | -r--r--r-- 63 ff45add45ab3f59c4f75efc6a087d86c821219d6.datapack | |
|
355 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack | |
|
356 | -r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack | |
|
357 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack | |
|
358 | -r--r--r-- 172 276d308429d0303762befa376788300f0310f90e.histpack | |
|
359 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack | |
|
344 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
360 | 345 | |
|
361 | 346 | $ hg pull |
|
362 | 347 | pulling from ssh://user@dummy/master |
@@ -366,26 +351,24 b' Pull should run background repack' | |||
|
366 | 351 | $ sleep 0.5 |
|
367 | 352 | $ hg debugwaitonrepack >/dev/null 2>&1 |
|
368 | 353 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
369 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
370 | -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack | |
|
354 | -r--r--r-- 301 09b8bf49256b3fc2175977ba97d6402e91a9a604.datapack | |
|
371 | 355 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
372 | 356 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack |
|
373 | 357 | |
|
374 | 358 | Test environment variable resolution |
|
375 | 359 | $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH' |
|
376 |
1 files fetched over 1 fetches - ( |
|
|
360 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
377 | 361 | $ find $TESTTMP/envcache | sort |
|
378 | 362 | $TESTTMP/envcache |
|
379 | 363 | $TESTTMP/envcache/master |
|
380 |
$TESTTMP/envcache/master/ |
|
|
381 | $TESTTMP/envcache/master/packs/54afbfda203716c1aa2636029ccc0df18165129e.dataidx | |
|
382 | $TESTTMP/envcache/master/packs/54afbfda203716c1aa2636029ccc0df18165129e.datapack | |
|
383 | $TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histidx | |
|
384 | $TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histpack | |
|
364 | $TESTTMP/envcache/master/95 | |
|
365 | $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a | |
|
366 | $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/577959738234a1eb241ed3ed4b22a575833f56e0 | |
|
367 | $TESTTMP/envcache/repos | |
|
385 | 368 | |
|
386 | 369 | Test local remotefilelog blob is correct when based on a pack |
|
387 | 370 | $ hg prefetch -r . |
|
388 |
1 files fetched over 1 fetches - ( |
|
|
371 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
389 | 372 | $ echo >> y |
|
390 | 373 | $ hg commit -m y2 |
|
391 | 374 | $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808 |
@@ -293,38 +293,32 b' Incremental repack' | |||
|
293 | 293 | > [remotefilelog] |
|
294 | 294 | > data.generations=60 |
|
295 | 295 | > 150 |
|
296 | > fetchpacks=True | |
|
297 | 296 | > EOF |
|
298 | 297 | |
|
299 | 298 | Single pack - repack does nothing |
|
300 | 299 | $ hg prefetch -r 0 |
|
301 |
1 files fetched over 1 fetches - ( |
|
|
300 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
302 | 301 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
303 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
302 | [1] | |
|
304 | 303 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
305 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack | |
|
304 | [1] | |
|
306 | 305 | $ hg repack --incremental |
|
307 | 306 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
308 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
307 | -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack | |
|
309 | 308 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
310 | 309 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack |
|
311 | 310 | |
|
312 | 311 | 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1 |
|
313 | 312 | $ hg prefetch -r 1 |
|
314 |
1 files fetched over 1 fetches - ( |
|
|
313 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
315 | 314 | $ hg prefetch -r 2 |
|
316 |
1 files fetched over 1 fetches - ( |
|
|
317 | $ hg prefetch -r 3 | |
|
318 | 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob) | |
|
315 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
316 | $ hg prefetch -r 38 | |
|
317 | abort: unknown revision '38'! | |
|
318 | [255] | |
|
319 | 319 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
320 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
321 | -r--r--r-- 65 6c499d21350d79f92fd556b4b7a902569d88e3c9.datapack | |
|
322 | -r--r--r-- 61 817d294043bd21a3de01f807721971abe45219ce.datapack | |
|
323 | -r--r--r-- 63 ff45add45ab3f59c4f75efc6a087d86c821219d6.datapack | |
|
320 | -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack | |
|
324 | 321 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
325 | -r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack | |
|
326 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack | |
|
327 | -r--r--r-- 172 276d308429d0303762befa376788300f0310f90e.histpack | |
|
328 | 322 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack |
|
329 | 323 | |
|
330 | 324 | For the data packs, setting the limit for the repackmaxpacksize to be 64 such |
@@ -335,14 +329,10 b' 0 which should always result in no repac' | |||
|
335 | 329 | $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=64 \ |
|
336 | 330 | > --config remotefilelog.history.repackmaxpacksize=0 |
|
337 | 331 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
338 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
339 | -r--r--r-- 65 6c499d21350d79f92fd556b4b7a902569d88e3c9.datapack | |
|
340 | -r--r--r-- 61 817d294043bd21a3de01f807721971abe45219ce.datapack | |
|
341 | -r--r--r-- 63 ff45add45ab3f59c4f75efc6a087d86c821219d6.datapack | |
|
332 | -r--r--r-- 147 935861cae0be6ce41a0d47a529e4d097e9e68a69.datapack | |
|
333 | -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack | |
|
342 | 334 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
343 | 335 | -r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack |
|
344 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack | |
|
345 | -r--r--r-- 172 276d308429d0303762befa376788300f0310f90e.histpack | |
|
346 | 336 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack |
|
347 | 337 | |
|
348 | 338 | Setting limit for the repackmaxpacksize to be the size of the biggest pack file |
@@ -350,18 +340,20 b' which ensures that it is effectively ign' | |||
|
350 | 340 | $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=65 \ |
|
351 | 341 | > --config remotefilelog.history.repackmaxpacksize=336 |
|
352 | 342 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
353 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
354 | -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack | |
|
343 | -r--r--r-- 147 935861cae0be6ce41a0d47a529e4d097e9e68a69.datapack | |
|
344 | -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack | |
|
355 | 345 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
356 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack | |
|
346 | -r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack | |
|
347 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack | |
|
357 | 348 | |
|
358 | 349 | 1 gen3 pack, 1 gen0 pack - does nothing |
|
359 | 350 | $ hg repack --incremental |
|
360 | 351 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
361 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
362 | -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack | |
|
352 | -r--r--r-- 147 935861cae0be6ce41a0d47a529e4d097e9e68a69.datapack | |
|
353 | -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack | |
|
363 | 354 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
364 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack | |
|
355 | -r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack | |
|
356 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack | |
|
365 | 357 | |
|
366 | 358 | Pull should run background repack |
|
367 | 359 | $ cat >> .hg/hgrc <<EOF |
@@ -370,23 +362,13 b' Pull should run background repack' | |||
|
370 | 362 | > EOF |
|
371 | 363 | $ clearcache |
|
372 | 364 | $ hg prefetch -r 0 |
|
373 |
1 files fetched over 1 fetches - ( |
|
|
365 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
374 | 366 | $ hg prefetch -r 1 |
|
375 |
1 files fetched over 1 fetches - ( |
|
|
367 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
376 | 368 | $ hg prefetch -r 2 |
|
377 |
1 files fetched over 1 fetches - ( |
|
|
369 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
378 | 370 | $ hg prefetch -r 3 |
|
379 |
1 files fetched over 1 fetches - ( |
|
|
380 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack | |
|
381 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
382 | -r--r--r-- 65 6c499d21350d79f92fd556b4b7a902569d88e3c9.datapack | |
|
383 | -r--r--r-- 61 817d294043bd21a3de01f807721971abe45219ce.datapack | |
|
384 | -r--r--r-- 63 ff45add45ab3f59c4f75efc6a087d86c821219d6.datapack | |
|
385 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack | |
|
386 | -r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack | |
|
387 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack | |
|
388 | -r--r--r-- 172 276d308429d0303762befa376788300f0310f90e.histpack | |
|
389 | -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack | |
|
371 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
390 | 372 | |
|
391 | 373 | $ hg pull |
|
392 | 374 | pulling from ssh://user@dummy/master |
@@ -396,26 +378,24 b' Pull should run background repack' | |||
|
396 | 378 | $ sleep 0.5 |
|
397 | 379 | $ hg debugwaitonrepack >/dev/null 2>&1 |
|
398 | 380 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack |
|
399 | -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack | |
|
400 | -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack | |
|
381 | -r--r--r-- 301 09b8bf49256b3fc2175977ba97d6402e91a9a604.datapack | |
|
401 | 382 | $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack |
|
402 | 383 | -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack |
|
403 | 384 | |
|
404 | 385 | Test environment variable resolution |
|
405 | 386 | $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH' |
|
406 |
1 files fetched over 1 fetches - ( |
|
|
387 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
407 | 388 | $ find $TESTTMP/envcache | sort |
|
408 | 389 | $TESTTMP/envcache |
|
409 | 390 | $TESTTMP/envcache/master |
|
410 |
$TESTTMP/envcache/master/ |
|
|
411 | $TESTTMP/envcache/master/packs/54afbfda203716c1aa2636029ccc0df18165129e.dataidx | |
|
412 | $TESTTMP/envcache/master/packs/54afbfda203716c1aa2636029ccc0df18165129e.datapack | |
|
413 | $TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histidx | |
|
414 | $TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histpack | |
|
391 | $TESTTMP/envcache/master/95 | |
|
392 | $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a | |
|
393 | $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/577959738234a1eb241ed3ed4b22a575833f56e0 | |
|
394 | $TESTTMP/envcache/repos | |
|
415 | 395 | |
|
416 | 396 | Test local remotefilelog blob is correct when based on a pack |
|
417 | 397 | $ hg prefetch -r . |
|
418 |
1 files fetched over 1 fetches - ( |
|
|
398 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | |
|
419 | 399 | $ echo >> y |
|
420 | 400 | $ hg commit -m y2 |
|
421 | 401 | $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808 |
@@ -434,7 +414,7 b' Test local remotefilelog blob is correct' | |||
|
434 | 414 | Test limiting the max delta chain length |
|
435 | 415 | $ hg repack --config packs.maxchainlen=1 |
|
436 | 416 | $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.dataidx |
|
437 |
$TESTTMP/hgcache/master/packs/a |
|
|
417 | $TESTTMP/hgcache/master/packs/a8378d888fe4325250720e51311a65d2509be742: | |
|
438 | 418 | x: |
|
439 | 419 | Node Delta Base Delta Length Blob Size |
|
440 | 420 | 1bb2e6237e03 000000000000 8 8 |
@@ -445,20 +425,20 b' Test limiting the max delta chain length' | |||
|
445 | 425 | Total: 36 20 (80.0% bigger) |
|
446 | 426 | y: |
|
447 | 427 | Node Delta Base Delta Length Blob Size |
|
448 |
577959738234 000000000000 |
|
|
428 | 577959738234 000000000000 70 8 | |
|
449 | 429 | |
|
450 |
Total: |
|
|
430 | Total: 70 8 (775.0% bigger) | |
|
451 | 431 | |
|
452 | 432 | Test huge pack cleanup using different values of packs.maxpacksize: |
|
453 | 433 | $ hg repack --incremental --debug |
|
454 | 434 | $ hg repack --incremental --debug --config packs.maxpacksize=512 |
|
455 |
removing oversize packfile $TESTTMP/hgcache/master/packs/a |
|
|
456 |
removing oversize packfile $TESTTMP/hgcache/master/packs/a |
|
|
435 | removing oversize packfile $TESTTMP/hgcache/master/packs/a8378d888fe4325250720e51311a65d2509be742.datapack (426 bytes) | |
|
436 | removing oversize packfile $TESTTMP/hgcache/master/packs/a8378d888fe4325250720e51311a65d2509be742.dataidx (1.21 KB) | |
|
457 | 437 | |
|
458 | 438 | Do a repack where the new pack reuses a delta from the old pack |
|
459 | 439 | $ clearcache |
|
460 | 440 | $ hg prefetch -r '2::3' |
|
461 |
2 files fetched over 1 fetches - ( |
|
|
441 | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob) | |
|
462 | 442 | $ hg repack |
|
463 | 443 | $ hg debugdatapack $CACHEDIR/master/packs/*.datapack |
|
464 | 444 | $TESTTMP/hgcache/master/packs/abf210f6c3aa4dd0ecc7033633ad73591be16c95: |
@@ -469,7 +449,7 b' Do a repack where the new pack reuses a ' | |||
|
469 | 449 | |
|
470 | 450 | Total: 20 14 (42.9% bigger) |
|
471 | 451 | $ hg prefetch -r '0::1' |
|
472 |
2 files fetched over 1 fetches - ( |
|
|
452 | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob) | |
|
473 | 453 | $ hg repack |
|
474 | 454 | $ hg debugdatapack $CACHEDIR/master/packs/*.datapack |
|
475 | 455 | $TESTTMP/hgcache/master/packs/09b8bf49256b3fc2175977ba97d6402e91a9a604: |
General Comments 0
You need to be logged in to leave comments.
Login now