##// END OF EJS Templates
remotefilelog: remove support for fetching packs...
Augie Fackler -
r40537:6d64e2ab default
parent child Browse files
Show More
@@ -58,7 +58,6 b' Configs:'
58 ``remotefilelog.debug`` turn on remotefilelog-specific debug output
58 ``remotefilelog.debug`` turn on remotefilelog-specific debug output
59 ``remotefilelog.excludepattern`` pattern of files to exclude from pulls
59 ``remotefilelog.excludepattern`` pattern of files to exclude from pulls
60 ``remotefilelog.includepattern``pattern of files to include in pulls
60 ``remotefilelog.includepattern``pattern of files to include in pulls
61 ``remotefilelog.fetchpacks`` if set, fetch pre-packed files from the server
62 ``remotefilelog.fetchwarning``: message to print when too many
61 ``remotefilelog.fetchwarning``: message to print when too many
63 single-file fetches occur
62 single-file fetches occur
64 ``remotefilelog.getfilesstep`` number of files to request in a single RPC
63 ``remotefilelog.getfilesstep`` number of files to request in a single RPC
@@ -153,7 +152,6 b" configitem('remotefilelog', 'cacheproces"
153 configitem('remotefilelog', 'cacheprocess.includepath', default=None)
152 configitem('remotefilelog', 'cacheprocess.includepath', default=None)
154 configitem("remotefilelog", "cachelimit", default="1000 GB")
153 configitem("remotefilelog", "cachelimit", default="1000 GB")
155
154
156 configitem('remotefilelog', 'fetchpacks', default=False)
157 configitem('remotefilelog', 'fallbackpath', default=configitems.dynamicdefault,
155 configitem('remotefilelog', 'fallbackpath', default=configitems.dynamicdefault,
158 alias=[('remotefilelog', 'fallbackrepo')])
156 alias=[('remotefilelog', 'fallbackrepo')])
159
157
@@ -10,7 +10,6 b' from __future__ import absolute_import'
10 import hashlib
10 import hashlib
11 import io
11 import io
12 import os
12 import os
13 import struct
14 import threading
13 import threading
15 import time
14 import time
16
15
@@ -30,8 +29,6 b' from . import ('
30 contentstore,
29 contentstore,
31 lz4wrapper,
30 lz4wrapper,
32 metadatastore,
31 metadatastore,
33 shallowutil,
34 wirepack,
35 )
32 )
36
33
37 _sshv1peer = sshpeer.sshv1peer
34 _sshv1peer = sshpeer.sshv1peer
@@ -316,10 +313,6 b' class fileserverclient(object):'
316 cache = self.remotecache
313 cache = self.remotecache
317 writedata = self.writedata
314 writedata = self.writedata
318
315
319 if self.ui.configbool('remotefilelog', 'fetchpacks'):
320 self.requestpack(fileids)
321 return
322
323 repo = self.repo
316 repo = self.repo
324 count = len(fileids)
317 count = len(fileids)
325 request = "get\n%d\n" % count
318 request = "get\n%d\n" % count
@@ -453,61 +446,6 b' class fileserverclient(object):'
453 self.writedata.addremotefilelognode(filename, bin(node),
446 self.writedata.addremotefilelognode(filename, bin(node),
454 lz4wrapper.lz4decompress(data))
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 def connect(self):
449 def connect(self):
512 if self.cacheprocess:
450 if self.cacheprocess:
513 cmd = "%s %s" % (self.cacheprocess, self.writedata._path)
451 cmd = "%s %s" % (self.cacheprocess, self.writedata._path)
@@ -118,9 +118,6 b' def makeunionstores(repo):'
118
118
119 fileservicedatawrite = cachecontent
119 fileservicedatawrite = cachecontent
120 fileservicehistorywrite = cachemetadata
120 fileservicehistorywrite = cachemetadata
121 if repo.ui.configbool('remotefilelog', 'fetchpacks'):
122 fileservicedatawrite = packcontentstore
123 fileservicehistorywrite = packmetadatastore
124 repo.fileservice.setstore(repo.contentstore, repo.metadatastore,
121 repo.fileservice.setstore(repo.contentstore, repo.metadatastore,
125 fileservicedatawrite, fileservicehistorywrite)
122 fileservicedatawrite, fileservicehistorywrite)
126 shallowutil.reportpackmetrics(repo.ui, 'filestore',
123 shallowutil.reportpackmetrics(repo.ui, 'filestore',
@@ -201,66 +201,36 b''
201 $ clearcache
201 $ clearcache
202 $ hg addremove -s 50 > /dev/null
202 $ hg addremove -s 50 > /dev/null
203 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
203 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
204
204 $ hg revert --all
205 $ cd ..
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 # Revert across double renames. Note: the scary "abort", error is because
213 # Revert across double renames. Note: the scary "abort", error is because
252 # https://bz.mercurial-scm.org/5419 .
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 $ clearcache
221 $ clearcache
255 $ hg mv y y2
222 $ hg mv y y2
223 y2: not overwriting - file exists
224 ('hg rename --after' to record the rename)
225 [1]
256 $ hg mv x x2
226 $ hg mv x x2
227 x2: not overwriting - file exists
228 ('hg rename --after' to record the rename)
229 [1]
257 $ hg mv z2 z3
230 $ hg mv z2 z3
231 z2: not copying - file is not managed
232 abort: no files to copy
233 [255]
258 $ hg revert -a -r 1 || true
234 $ hg revert -a -r 1 || true
259 forgetting x2
235 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
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)
266 abort: z2@109c3a557a73: not found in manifest! (?)
236 abort: z2@109c3a557a73: not found in manifest! (?)
@@ -285,53 +285,48 b' Incremental repack'
285 > [remotefilelog]
285 > [remotefilelog]
286 > data.generations=60
286 > data.generations=60
287 > 150
287 > 150
288 > fetchpacks=True
289 > EOF
288 > EOF
290
289
291 Single pack - repack does nothing
290 Single pack - repack does nothing
292 $ hg prefetch -r 0
291 $ hg prefetch -r 0
293 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
292 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
294 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
293 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
295 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
294 [1]
296 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
295 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
297 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
296 [1]
298 $ hg repack --incremental
297 $ hg repack --incremental
299 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
298 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
300 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
299 -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack
301 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
300 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
302 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
301 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
303
302
304 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
303 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
305 $ hg prefetch -r 1
304 $ hg prefetch -r 1
306 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
305 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
307 $ hg prefetch -r 2
306 $ hg prefetch -r 2
308 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
307 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
309 $ hg prefetch -r 3
308 $ hg prefetch -r 3
310 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
309 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
311 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
310 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
312 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
311 -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack
313 -r--r--r-- 65 6c499d21350d79f92fd556b4b7a902569d88e3c9.datapack
314 -r--r--r-- 61 817d294043bd21a3de01f807721971abe45219ce.datapack
315 -r--r--r-- 63 ff45add45ab3f59c4f75efc6a087d86c821219d6.datapack
316 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
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 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
313 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
321 $ hg repack --incremental
314 $ hg repack --incremental
322 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
315 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
323 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
324 -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack
316 -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack
317 -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack
325 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
318 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
326 -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
319 -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
320 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
327
321
328 1 gen3 pack, 1 gen0 pack - does nothing
322 1 gen3 pack, 1 gen0 pack - does nothing
329 $ hg repack --incremental
323 $ hg repack --incremental
330 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
324 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
331 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
332 -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack
325 -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack
326 -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack
333 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
327 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
334 -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
328 -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
329 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
335
330
336 Pull should run background repack
331 Pull should run background repack
337 $ cat >> .hg/hgrc <<EOF
332 $ cat >> .hg/hgrc <<EOF
@@ -340,23 +335,13 b' Pull should run background repack'
340 > EOF
335 > EOF
341 $ clearcache
336 $ clearcache
342 $ hg prefetch -r 0
337 $ hg prefetch -r 0
343 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
338 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
344 $ hg prefetch -r 1
339 $ hg prefetch -r 1
345 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
340 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
346 $ hg prefetch -r 2
341 $ hg prefetch -r 2
347 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
342 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
348 $ hg prefetch -r 3
343 $ hg prefetch -r 3
349 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
344 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
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
360
345
361 $ hg pull
346 $ hg pull
362 pulling from ssh://user@dummy/master
347 pulling from ssh://user@dummy/master
@@ -366,26 +351,24 b' Pull should run background repack'
366 $ sleep 0.5
351 $ sleep 0.5
367 $ hg debugwaitonrepack >/dev/null 2>&1
352 $ hg debugwaitonrepack >/dev/null 2>&1
368 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
353 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
369 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
354 -r--r--r-- 301 09b8bf49256b3fc2175977ba97d6402e91a9a604.datapack
370 -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack
371 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
355 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
372 -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
356 -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
373
357
374 Test environment variable resolution
358 Test environment variable resolution
375 $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
359 $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
376 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
360 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
377 $ find $TESTTMP/envcache | sort
361 $ find $TESTTMP/envcache | sort
378 $TESTTMP/envcache
362 $TESTTMP/envcache
379 $TESTTMP/envcache/master
363 $TESTTMP/envcache/master
380 $TESTTMP/envcache/master/packs
364 $TESTTMP/envcache/master/95
381 $TESTTMP/envcache/master/packs/54afbfda203716c1aa2636029ccc0df18165129e.dataidx
365 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a
382 $TESTTMP/envcache/master/packs/54afbfda203716c1aa2636029ccc0df18165129e.datapack
366 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/577959738234a1eb241ed3ed4b22a575833f56e0
383 $TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histidx
367 $TESTTMP/envcache/repos
384 $TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histpack
385
368
386 Test local remotefilelog blob is correct when based on a pack
369 Test local remotefilelog blob is correct when based on a pack
387 $ hg prefetch -r .
370 $ hg prefetch -r .
388 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
371 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
389 $ echo >> y
372 $ echo >> y
390 $ hg commit -m y2
373 $ hg commit -m y2
391 $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
374 $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
@@ -293,38 +293,32 b' Incremental repack'
293 > [remotefilelog]
293 > [remotefilelog]
294 > data.generations=60
294 > data.generations=60
295 > 150
295 > 150
296 > fetchpacks=True
297 > EOF
296 > EOF
298
297
299 Single pack - repack does nothing
298 Single pack - repack does nothing
300 $ hg prefetch -r 0
299 $ hg prefetch -r 0
301 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
300 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
302 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
301 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
303 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
302 [1]
304 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
303 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
305 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
304 [1]
306 $ hg repack --incremental
305 $ hg repack --incremental
307 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
306 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
308 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
307 -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack
309 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
308 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
310 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
309 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
311
310
312 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
311 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
313 $ hg prefetch -r 1
312 $ hg prefetch -r 1
314 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
313 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
315 $ hg prefetch -r 2
314 $ hg prefetch -r 2
316 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)
317 $ hg prefetch -r 3
316 $ hg prefetch -r 38
318 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
317 abort: unknown revision '38'!
318 [255]
319 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
319 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
320 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
320 -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack
321 -r--r--r-- 65 6c499d21350d79f92fd556b4b7a902569d88e3c9.datapack
322 -r--r--r-- 61 817d294043bd21a3de01f807721971abe45219ce.datapack
323 -r--r--r-- 63 ff45add45ab3f59c4f75efc6a087d86c821219d6.datapack
324 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
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 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
322 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
329
323
330 For the data packs, setting the limit for the repackmaxpacksize to be 64 such
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 $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=64 \
329 $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=64 \
336 > --config remotefilelog.history.repackmaxpacksize=0
330 > --config remotefilelog.history.repackmaxpacksize=0
337 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
331 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
338 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
332 -r--r--r-- 147 935861cae0be6ce41a0d47a529e4d097e9e68a69.datapack
339 -r--r--r-- 65 6c499d21350d79f92fd556b4b7a902569d88e3c9.datapack
333 -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack
340 -r--r--r-- 61 817d294043bd21a3de01f807721971abe45219ce.datapack
341 -r--r--r-- 63 ff45add45ab3f59c4f75efc6a087d86c821219d6.datapack
342 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
334 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
343 -r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
335 -r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
344 -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
345 -r--r--r-- 172 276d308429d0303762befa376788300f0310f90e.histpack
346 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
336 -r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
347
337
348 Setting limit for the repackmaxpacksize to be the size of the biggest pack file
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 $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=65 \
340 $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=65 \
351 > --config remotefilelog.history.repackmaxpacksize=336
341 > --config remotefilelog.history.repackmaxpacksize=336
352 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
342 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
353 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
343 -r--r--r-- 147 935861cae0be6ce41a0d47a529e4d097e9e68a69.datapack
354 -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack
344 -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack
355 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
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 1 gen3 pack, 1 gen0 pack - does nothing
349 1 gen3 pack, 1 gen0 pack - does nothing
359 $ hg repack --incremental
350 $ hg repack --incremental
360 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
351 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
361 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
352 -r--r--r-- 147 935861cae0be6ce41a0d47a529e4d097e9e68a69.datapack
362 -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack
353 -r--r--r-- 67 b5a62f3496ccbd2479497cdbc7345f3304735f33.datapack
363 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
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 Pull should run background repack
358 Pull should run background repack
367 $ cat >> .hg/hgrc <<EOF
359 $ cat >> .hg/hgrc <<EOF
@@ -370,23 +362,13 b' Pull should run background repack'
370 > EOF
362 > EOF
371 $ clearcache
363 $ clearcache
372 $ hg prefetch -r 0
364 $ hg prefetch -r 0
373 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
365 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
374 $ hg prefetch -r 1
366 $ hg prefetch -r 1
375 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
367 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
376 $ hg prefetch -r 2
368 $ hg prefetch -r 2
377 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
369 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
378 $ hg prefetch -r 3
370 $ hg prefetch -r 3
379 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
371 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
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
390
372
391 $ hg pull
373 $ hg pull
392 pulling from ssh://user@dummy/master
374 pulling from ssh://user@dummy/master
@@ -396,26 +378,24 b' Pull should run background repack'
396 $ sleep 0.5
378 $ sleep 0.5
397 $ hg debugwaitonrepack >/dev/null 2>&1
379 $ hg debugwaitonrepack >/dev/null 2>&1
398 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
380 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
399 -r--r--r-- 59 5b7dec902026f0cddb0ef8acb62f27b5698494d4.datapack
381 -r--r--r-- 301 09b8bf49256b3fc2175977ba97d6402e91a9a604.datapack
400 -r--r--r-- 225 8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack
401 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
382 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
402 -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
383 -r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
403
384
404 Test environment variable resolution
385 Test environment variable resolution
405 $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
386 $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
406 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
387 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
407 $ find $TESTTMP/envcache | sort
388 $ find $TESTTMP/envcache | sort
408 $TESTTMP/envcache
389 $TESTTMP/envcache
409 $TESTTMP/envcache/master
390 $TESTTMP/envcache/master
410 $TESTTMP/envcache/master/packs
391 $TESTTMP/envcache/master/95
411 $TESTTMP/envcache/master/packs/54afbfda203716c1aa2636029ccc0df18165129e.dataidx
392 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a
412 $TESTTMP/envcache/master/packs/54afbfda203716c1aa2636029ccc0df18165129e.datapack
393 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/577959738234a1eb241ed3ed4b22a575833f56e0
413 $TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histidx
394 $TESTTMP/envcache/repos
414 $TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histpack
415
395
416 Test local remotefilelog blob is correct when based on a pack
396 Test local remotefilelog blob is correct when based on a pack
417 $ hg prefetch -r .
397 $ hg prefetch -r .
418 1 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
398 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
419 $ echo >> y
399 $ echo >> y
420 $ hg commit -m y2
400 $ hg commit -m y2
421 $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
401 $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
@@ -434,7 +414,7 b' Test local remotefilelog blob is correct'
434 Test limiting the max delta chain length
414 Test limiting the max delta chain length
435 $ hg repack --config packs.maxchainlen=1
415 $ hg repack --config packs.maxchainlen=1
436 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.dataidx
416 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.dataidx
437 $TESTTMP/hgcache/master/packs/a2731c9a16403457b67337a620931797fce8c821:
417 $TESTTMP/hgcache/master/packs/a8378d888fe4325250720e51311a65d2509be742:
438 x:
418 x:
439 Node Delta Base Delta Length Blob Size
419 Node Delta Base Delta Length Blob Size
440 1bb2e6237e03 000000000000 8 8
420 1bb2e6237e03 000000000000 8 8
@@ -445,20 +425,20 b' Test limiting the max delta chain length'
445 Total: 36 20 (80.0% bigger)
425 Total: 36 20 (80.0% bigger)
446 y:
426 y:
447 Node Delta Base Delta Length Blob Size
427 Node Delta Base Delta Length Blob Size
448 577959738234 000000000000 8 8
428 577959738234 000000000000 70 8
449
429
450 Total: 8 8 (0.0% bigger)
430 Total: 70 8 (775.0% bigger)
451
431
452 Test huge pack cleanup using different values of packs.maxpacksize:
432 Test huge pack cleanup using different values of packs.maxpacksize:
453 $ hg repack --incremental --debug
433 $ hg repack --incremental --debug
454 $ hg repack --incremental --debug --config packs.maxpacksize=512
434 $ hg repack --incremental --debug --config packs.maxpacksize=512
455 removing oversize packfile $TESTTMP/hgcache/master/packs/a2731c9a16403457b67337a620931797fce8c821.datapack (365 bytes)
435 removing oversize packfile $TESTTMP/hgcache/master/packs/a8378d888fe4325250720e51311a65d2509be742.datapack (426 bytes)
456 removing oversize packfile $TESTTMP/hgcache/master/packs/a2731c9a16403457b67337a620931797fce8c821.dataidx (1.21 KB)
436 removing oversize packfile $TESTTMP/hgcache/master/packs/a8378d888fe4325250720e51311a65d2509be742.dataidx (1.21 KB)
457
437
458 Do a repack where the new pack reuses a delta from the old pack
438 Do a repack where the new pack reuses a delta from the old pack
459 $ clearcache
439 $ clearcache
460 $ hg prefetch -r '2::3'
440 $ hg prefetch -r '2::3'
461 2 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
441 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob)
462 $ hg repack
442 $ hg repack
463 $ hg debugdatapack $CACHEDIR/master/packs/*.datapack
443 $ hg debugdatapack $CACHEDIR/master/packs/*.datapack
464 $TESTTMP/hgcache/master/packs/abf210f6c3aa4dd0ecc7033633ad73591be16c95:
444 $TESTTMP/hgcache/master/packs/abf210f6c3aa4dd0ecc7033633ad73591be16c95:
@@ -469,7 +449,7 b' Do a repack where the new pack reuses a '
469
449
470 Total: 20 14 (42.9% bigger)
450 Total: 20 14 (42.9% bigger)
471 $ hg prefetch -r '0::1'
451 $ hg prefetch -r '0::1'
472 2 files fetched over 1 fetches - (0 misses, 100.00% hit ratio) over * (glob)
452 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob)
473 $ hg repack
453 $ hg repack
474 $ hg debugdatapack $CACHEDIR/master/packs/*.datapack
454 $ hg debugdatapack $CACHEDIR/master/packs/*.datapack
475 $TESTTMP/hgcache/master/packs/09b8bf49256b3fc2175977ba97d6402e91a9a604:
455 $TESTTMP/hgcache/master/packs/09b8bf49256b3fc2175977ba97d6402e91a9a604:
General Comments 0
You need to be logged in to leave comments. Login now