##// END OF EJS Templates
treemanifests: fix streaming clone...
Martin von Zweigbergk -
r28007:fb92927f default
parent child Browse files
Show More
@@ -273,6 +273,16 b' def rebuildfncache(ui, repo):'
273 273
274 274 ui.progress(_('changeset'), None)
275 275
276 if 'treemanifest' in repo: # safe but unnecessary otherwise
277 for dir in util.dirs(seenfiles):
278 i = 'meta/%s/00manifest.i' % dir
279 d = 'meta/%s/00manifest.d' % dir
280
281 if repo.store._exists(i):
282 newentries.add(i)
283 if repo.store._exists(d):
284 newentries.add(d)
285
276 286 addcount = len(newentries - oldentries)
277 287 removecount = len(oldentries - newentries)
278 288 for p in sorted(oldentries - newentries):
@@ -330,7 +330,7 b' class basicstore(object):'
330 330 return l
331 331
332 332 def datafiles(self):
333 return self._walk('data', True)
333 return self._walk('data', True) + self._walk('meta', True)
334 334
335 335 def topfiles(self):
336 336 # yield manifest before changelog
@@ -378,7 +378,7 b' class encodedstore(basicstore):'
378 378 self.opener = self.vfs
379 379
380 380 def datafiles(self):
381 for a, b, size in self._walk('data', True):
381 for a, b, size in super(encodedstore, self).datafiles():
382 382 try:
383 383 a = decodefilename(a)
384 384 except KeyError:
@@ -460,7 +460,8 b' class _fncachevfs(scmutil.abstractvfs, s'
460 460 self.encode = encode
461 461
462 462 def __call__(self, path, mode='r', *args, **kw):
463 if mode not in ('r', 'rb') and path.startswith('data/'):
463 if mode not in ('r', 'rb') and (path.startswith('data/') or
464 path.startswith('meta/')):
464 465 self.fncache.add(path)
465 466 return self.vfs(self.encode(path), mode, *args, **kw)
466 467
@@ -284,7 +284,7 b' class verifier(object):'
284 284 for f, f2, size in repo.store.datafiles():
285 285 if not f:
286 286 self.err(None, _("cannot decode filename '%s'") % f2)
287 elif size > 0 or not revlogv1:
287 elif (size > 0 or not revlogv1) and f.startswith('data/'):
288 288 storefiles.add(_normpath(f))
289 289
290 290 files = sorted(set(filenodes) | set(filelinkrevs))
@@ -719,6 +719,8 b' class Test(unittest.TestCase):'
719 719 (br':%d\b' % self._startport, b':$HGPORT'),
720 720 (br':%d\b' % (self._startport + 1), b':$HGPORT1'),
721 721 (br':%d\b' % (self._startport + 2), b':$HGPORT2'),
722 (br':%d\b' % (self._startport + 2), b':$HGPORT3'),
723 (br':%d\b' % (self._startport + 2), b':$HGPORT4'),
722 724 (br'(?m)^(saved backup bundle to .*\.hg)( \(glob\))?$',
723 725 br'\1 (glob)'),
724 726 ]
@@ -741,6 +743,8 b' class Test(unittest.TestCase):'
741 743 env["HGPORT"] = str(self._startport)
742 744 env["HGPORT1"] = str(self._startport + 1)
743 745 env["HGPORT2"] = str(self._startport + 2)
746 env["HGPORT3"] = str(self._startport + 3)
747 env["HGPORT4"] = str(self._startport + 4)
744 748 env["HGRCPATH"] = os.path.join(self._threadtmp, b'.hgrc')
745 749 env["DAEMON_PIDS"] = os.path.join(self._threadtmp, b'daemon.pids')
746 750 env["HGEDITOR"] = ('"' + sys.executable + '"'
@@ -367,7 +367,7 b' Create deeper repo with tree manifests.'
367 367 $ hg --config experimental.treemanifest=True init deeprepo
368 368 $ cd deeprepo
369 369
370 $ mkdir a
370 $ mkdir .A
371 371 $ mkdir b
372 372 $ mkdir b/bar
373 373 $ mkdir b/bar/orange
@@ -376,8 +376,8 b' Create deeper repo with tree manifests.'
376 376 $ mkdir b/foo/apple
377 377 $ mkdir b/foo/apple/bees
378 378
379 $ touch a/one.txt
380 $ touch a/two.txt
379 $ touch .A/one.txt
380 $ touch .A/two.txt
381 381 $ touch b/bar/fruits.txt
382 382 $ touch b/bar/orange/fly/gnat.py
383 383 $ touch b/bar/orange/fly/housefly.txt
@@ -393,8 +393,8 b' the files command with various parameter'
393 393 Test files from the root.
394 394
395 395 $ hg files -r .
396 a/one.txt (glob)
397 a/two.txt (glob)
396 .A/one.txt (glob)
397 .A/two.txt (glob)
398 398 b/bar/fruits.txt (glob)
399 399 b/bar/orange/fly/gnat.py (glob)
400 400 b/bar/orange/fly/housefly.txt (glob)
@@ -412,7 +412,7 b' Excludes with a glob should not exclude '
412 412
413 413 Test files for a subdirectory.
414 414
415 $ rm -r .hg/store/meta/a
415 $ rm -r .hg/store/meta/~2e_a
416 416 $ hg files -r . b
417 417 b/bar/fruits.txt (glob)
418 418 b/bar/orange/fly/gnat.py (glob)
@@ -422,7 +422,7 b' Test files for a subdirectory.'
422 422
423 423 Test files with just includes and excludes.
424 424
425 $ rm -r .hg/store/meta/a
425 $ rm -r .hg/store/meta/~2e_a
426 426 $ rm -r .hg/store/meta/b/bar/orange/fly
427 427 $ rm -r .hg/store/meta/b/foo/apple/bees
428 428 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
@@ -431,7 +431,7 b' Test files with just includes and exclud'
431 431
432 432 Test files for a subdirectory, excluding a directory within it.
433 433
434 $ rm -r .hg/store/meta/a
434 $ rm -r .hg/store/meta/~2e_a
435 435 $ rm -r .hg/store/meta/b/foo
436 436 $ hg files -r . -X path:b/foo b
437 437 b/bar/fruits.txt (glob)
@@ -442,7 +442,7 b' Test files for a subdirectory, excluding'
442 442 Test files for a sub directory, including only a directory within it, and
443 443 including an unrelated directory.
444 444
445 $ rm -r .hg/store/meta/a
445 $ rm -r .hg/store/meta/~2e_a
446 446 $ rm -r .hg/store/meta/b/foo
447 447 $ hg files -r . -I path:b/bar/orange -I path:a b
448 448 b/bar/orange/fly/gnat.py (glob)
@@ -452,7 +452,7 b' including an unrelated directory.'
452 452 Test files for a pattern, including a directory, and excluding a directory
453 453 within that.
454 454
455 $ rm -r .hg/store/meta/a
455 $ rm -r .hg/store/meta/~2e_a
456 456 $ rm -r .hg/store/meta/b/foo
457 457 $ rm -r .hg/store/meta/b/bar/orange
458 458 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
@@ -488,8 +488,6 b' requires got updated to include treemani'
488 488 Tree manifest revlogs exist.
489 489 $ find deepclone/.hg/store/meta | sort
490 490 deepclone/.hg/store/meta
491 deepclone/.hg/store/meta/a
492 deepclone/.hg/store/meta/a/00manifest.i
493 491 deepclone/.hg/store/meta/b
494 492 deepclone/.hg/store/meta/b/00manifest.i
495 493 deepclone/.hg/store/meta/b/bar
@@ -504,6 +502,8 b' Tree manifest revlogs exist.'
504 502 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
505 503 deepclone/.hg/store/meta/b/foo/apple/bees
506 504 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
505 deepclone/.hg/store/meta/~2e_a
506 deepclone/.hg/store/meta/~2e_a/00manifest.i
507 507 Verify passes.
508 508 $ cd deepclone
509 509 $ hg verify
@@ -525,8 +525,12 b' Create clones using old repo formats to '
525 525 added 3 changesets with 10 changes to 8 files
526 526 updating to branch default
527 527 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
528 $ grep store deeprepo-basicstore/.hg/requires
528 $ cd deeprepo-basicstore
529 $ grep store .hg/requires
529 530 [1]
531 $ hg serve -p $HGPORT3 -d --pid-file=hg.pid --errorlog=errors.log
532 $ cat hg.pid >> $DAEMON_PIDS
533 $ cd ..
530 534 $ hg clone --config format.usefncache=False \
531 535 > --config experimental.changegroup3=True \
532 536 > http://localhost:$HGPORT2 deeprepo-encodedstore
@@ -537,8 +541,12 b' Create clones using old repo formats to '
537 541 added 3 changesets with 10 changes to 8 files
538 542 updating to branch default
539 543 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
540 $ grep fncache deeprepo-encodedstore/.hg/requires
544 $ cd deeprepo-encodedstore
545 $ grep fncache .hg/requires
541 546 [1]
547 $ hg serve -p $HGPORT4 -d --pid-file=hg.pid --errorlog=errors.log
548 $ cat hg.pid >> $DAEMON_PIDS
549 $ cd ..
542 550
543 551 Local clone with basicstore
544 552 $ hg clone -U deeprepo-basicstore local-clone-basicstore
@@ -566,3 +574,55 b' Local clone with fncachestore'
566 574 crosschecking files in changesets and manifests
567 575 checking files
568 576 8 files, 3 changesets, 10 total revisions
577
578 Stream clone with basicstore
579 $ hg clone --config experimental.changegroup3=True --uncompressed -U \
580 > http://localhost:$HGPORT3 stream-clone-basicstore
581 streaming all changes
582 18 files to transfer, * of data (glob)
583 transferred * in * seconds (*) (glob)
584 searching for changes
585 no changes found
586 $ hg -R stream-clone-basicstore verify
587 checking changesets
588 checking manifests
589 crosschecking files in changesets and manifests
590 checking files
591 8 files, 3 changesets, 10 total revisions
592
593 Stream clone with encodedstore
594 $ hg clone --config experimental.changegroup3=True --uncompressed -U \
595 > http://localhost:$HGPORT4 stream-clone-encodedstore
596 streaming all changes
597 18 files to transfer, * of data (glob)
598 transferred * in * seconds (*) (glob)
599 searching for changes
600 no changes found
601 $ hg -R stream-clone-encodedstore verify
602 checking changesets
603 checking manifests
604 crosschecking files in changesets and manifests
605 checking files
606 8 files, 3 changesets, 10 total revisions
607
608 Stream clone with fncachestore
609 $ hg clone --config experimental.changegroup3=True --uncompressed -U \
610 > http://localhost:$HGPORT2 stream-clone-fncachestore
611 streaming all changes
612 18 files to transfer, * of data (glob)
613 transferred * in * seconds (*) (glob)
614 searching for changes
615 no changes found
616 $ hg -R stream-clone-fncachestore verify
617 checking changesets
618 checking manifests
619 crosschecking files in changesets and manifests
620 checking files
621 8 files, 3 changesets, 10 total revisions
622
623 Packed bundle
624 $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg
625 writing 3349 bytes for 18 files
626 bundle requirements: generaldelta, revlogv1, treemanifest
627 $ hg debugbundle --spec repo-packed.hg
628 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Ctreemanifest
General Comments 0
You need to be logged in to leave comments. Login now