##// 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 ui.progress(_('changeset'), None)
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 addcount = len(newentries - oldentries)
286 addcount = len(newentries - oldentries)
277 removecount = len(oldentries - newentries)
287 removecount = len(oldentries - newentries)
278 for p in sorted(oldentries - newentries):
288 for p in sorted(oldentries - newentries):
@@ -330,7 +330,7 b' class basicstore(object):'
330 return l
330 return l
331
331
332 def datafiles(self):
332 def datafiles(self):
333 return self._walk('data', True)
333 return self._walk('data', True) + self._walk('meta', True)
334
334
335 def topfiles(self):
335 def topfiles(self):
336 # yield manifest before changelog
336 # yield manifest before changelog
@@ -378,7 +378,7 b' class encodedstore(basicstore):'
378 self.opener = self.vfs
378 self.opener = self.vfs
379
379
380 def datafiles(self):
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 try:
382 try:
383 a = decodefilename(a)
383 a = decodefilename(a)
384 except KeyError:
384 except KeyError:
@@ -460,7 +460,8 b' class _fncachevfs(scmutil.abstractvfs, s'
460 self.encode = encode
460 self.encode = encode
461
461
462 def __call__(self, path, mode='r', *args, **kw):
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 self.fncache.add(path)
465 self.fncache.add(path)
465 return self.vfs(self.encode(path), mode, *args, **kw)
466 return self.vfs(self.encode(path), mode, *args, **kw)
466
467
@@ -284,7 +284,7 b' class verifier(object):'
284 for f, f2, size in repo.store.datafiles():
284 for f, f2, size in repo.store.datafiles():
285 if not f:
285 if not f:
286 self.err(None, _("cannot decode filename '%s'") % f2)
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 storefiles.add(_normpath(f))
288 storefiles.add(_normpath(f))
289
289
290 files = sorted(set(filenodes) | set(filelinkrevs))
290 files = sorted(set(filenodes) | set(filelinkrevs))
@@ -719,6 +719,8 b' class Test(unittest.TestCase):'
719 (br':%d\b' % self._startport, b':$HGPORT'),
719 (br':%d\b' % self._startport, b':$HGPORT'),
720 (br':%d\b' % (self._startport + 1), b':$HGPORT1'),
720 (br':%d\b' % (self._startport + 1), b':$HGPORT1'),
721 (br':%d\b' % (self._startport + 2), b':$HGPORT2'),
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 (br'(?m)^(saved backup bundle to .*\.hg)( \(glob\))?$',
724 (br'(?m)^(saved backup bundle to .*\.hg)( \(glob\))?$',
723 br'\1 (glob)'),
725 br'\1 (glob)'),
724 ]
726 ]
@@ -741,6 +743,8 b' class Test(unittest.TestCase):'
741 env["HGPORT"] = str(self._startport)
743 env["HGPORT"] = str(self._startport)
742 env["HGPORT1"] = str(self._startport + 1)
744 env["HGPORT1"] = str(self._startport + 1)
743 env["HGPORT2"] = str(self._startport + 2)
745 env["HGPORT2"] = str(self._startport + 2)
746 env["HGPORT3"] = str(self._startport + 3)
747 env["HGPORT4"] = str(self._startport + 4)
744 env["HGRCPATH"] = os.path.join(self._threadtmp, b'.hgrc')
748 env["HGRCPATH"] = os.path.join(self._threadtmp, b'.hgrc')
745 env["DAEMON_PIDS"] = os.path.join(self._threadtmp, b'daemon.pids')
749 env["DAEMON_PIDS"] = os.path.join(self._threadtmp, b'daemon.pids')
746 env["HGEDITOR"] = ('"' + sys.executable + '"'
750 env["HGEDITOR"] = ('"' + sys.executable + '"'
@@ -367,7 +367,7 b' Create deeper repo with tree manifests.'
367 $ hg --config experimental.treemanifest=True init deeprepo
367 $ hg --config experimental.treemanifest=True init deeprepo
368 $ cd deeprepo
368 $ cd deeprepo
369
369
370 $ mkdir a
370 $ mkdir .A
371 $ mkdir b
371 $ mkdir b
372 $ mkdir b/bar
372 $ mkdir b/bar
373 $ mkdir b/bar/orange
373 $ mkdir b/bar/orange
@@ -376,8 +376,8 b' Create deeper repo with tree manifests.'
376 $ mkdir b/foo/apple
376 $ mkdir b/foo/apple
377 $ mkdir b/foo/apple/bees
377 $ mkdir b/foo/apple/bees
378
378
379 $ touch a/one.txt
379 $ touch .A/one.txt
380 $ touch a/two.txt
380 $ touch .A/two.txt
381 $ touch b/bar/fruits.txt
381 $ touch b/bar/fruits.txt
382 $ touch b/bar/orange/fly/gnat.py
382 $ touch b/bar/orange/fly/gnat.py
383 $ touch b/bar/orange/fly/housefly.txt
383 $ touch b/bar/orange/fly/housefly.txt
@@ -393,8 +393,8 b' the files command with various parameter'
393 Test files from the root.
393 Test files from the root.
394
394
395 $ hg files -r .
395 $ hg files -r .
396 a/one.txt (glob)
396 .A/one.txt (glob)
397 a/two.txt (glob)
397 .A/two.txt (glob)
398 b/bar/fruits.txt (glob)
398 b/bar/fruits.txt (glob)
399 b/bar/orange/fly/gnat.py (glob)
399 b/bar/orange/fly/gnat.py (glob)
400 b/bar/orange/fly/housefly.txt (glob)
400 b/bar/orange/fly/housefly.txt (glob)
@@ -412,7 +412,7 b' Excludes with a glob should not exclude '
412
412
413 Test files for a subdirectory.
413 Test files for a subdirectory.
414
414
415 $ rm -r .hg/store/meta/a
415 $ rm -r .hg/store/meta/~2e_a
416 $ hg files -r . b
416 $ hg files -r . b
417 b/bar/fruits.txt (glob)
417 b/bar/fruits.txt (glob)
418 b/bar/orange/fly/gnat.py (glob)
418 b/bar/orange/fly/gnat.py (glob)
@@ -422,7 +422,7 b' Test files for a subdirectory.'
422
422
423 Test files with just includes and excludes.
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 $ rm -r .hg/store/meta/b/bar/orange/fly
426 $ rm -r .hg/store/meta/b/bar/orange/fly
427 $ rm -r .hg/store/meta/b/foo/apple/bees
427 $ rm -r .hg/store/meta/b/foo/apple/bees
428 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
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 Test files for a subdirectory, excluding a directory within it.
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 $ rm -r .hg/store/meta/b/foo
435 $ rm -r .hg/store/meta/b/foo
436 $ hg files -r . -X path:b/foo b
436 $ hg files -r . -X path:b/foo b
437 b/bar/fruits.txt (glob)
437 b/bar/fruits.txt (glob)
@@ -442,7 +442,7 b' Test files for a subdirectory, excluding'
442 Test files for a sub directory, including only a directory within it, and
442 Test files for a sub directory, including only a directory within it, and
443 including an unrelated directory.
443 including an unrelated directory.
444
444
445 $ rm -r .hg/store/meta/a
445 $ rm -r .hg/store/meta/~2e_a
446 $ rm -r .hg/store/meta/b/foo
446 $ rm -r .hg/store/meta/b/foo
447 $ hg files -r . -I path:b/bar/orange -I path:a b
447 $ hg files -r . -I path:b/bar/orange -I path:a b
448 b/bar/orange/fly/gnat.py (glob)
448 b/bar/orange/fly/gnat.py (glob)
@@ -452,7 +452,7 b' including an unrelated directory.'
452 Test files for a pattern, including a directory, and excluding a directory
452 Test files for a pattern, including a directory, and excluding a directory
453 within that.
453 within that.
454
454
455 $ rm -r .hg/store/meta/a
455 $ rm -r .hg/store/meta/~2e_a
456 $ rm -r .hg/store/meta/b/foo
456 $ rm -r .hg/store/meta/b/foo
457 $ rm -r .hg/store/meta/b/bar/orange
457 $ rm -r .hg/store/meta/b/bar/orange
458 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
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 Tree manifest revlogs exist.
488 Tree manifest revlogs exist.
489 $ find deepclone/.hg/store/meta | sort
489 $ find deepclone/.hg/store/meta | sort
490 deepclone/.hg/store/meta
490 deepclone/.hg/store/meta
491 deepclone/.hg/store/meta/a
492 deepclone/.hg/store/meta/a/00manifest.i
493 deepclone/.hg/store/meta/b
491 deepclone/.hg/store/meta/b
494 deepclone/.hg/store/meta/b/00manifest.i
492 deepclone/.hg/store/meta/b/00manifest.i
495 deepclone/.hg/store/meta/b/bar
493 deepclone/.hg/store/meta/b/bar
@@ -504,6 +502,8 b' Tree manifest revlogs exist.'
504 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
502 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
505 deepclone/.hg/store/meta/b/foo/apple/bees
503 deepclone/.hg/store/meta/b/foo/apple/bees
506 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
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 Verify passes.
507 Verify passes.
508 $ cd deepclone
508 $ cd deepclone
509 $ hg verify
509 $ hg verify
@@ -525,8 +525,12 b' Create clones using old repo formats to '
525 added 3 changesets with 10 changes to 8 files
525 added 3 changesets with 10 changes to 8 files
526 updating to branch default
526 updating to branch default
527 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
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 [1]
530 [1]
531 $ hg serve -p $HGPORT3 -d --pid-file=hg.pid --errorlog=errors.log
532 $ cat hg.pid >> $DAEMON_PIDS
533 $ cd ..
530 $ hg clone --config format.usefncache=False \
534 $ hg clone --config format.usefncache=False \
531 > --config experimental.changegroup3=True \
535 > --config experimental.changegroup3=True \
532 > http://localhost:$HGPORT2 deeprepo-encodedstore
536 > http://localhost:$HGPORT2 deeprepo-encodedstore
@@ -537,8 +541,12 b' Create clones using old repo formats to '
537 added 3 changesets with 10 changes to 8 files
541 added 3 changesets with 10 changes to 8 files
538 updating to branch default
542 updating to branch default
539 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
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 [1]
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 Local clone with basicstore
551 Local clone with basicstore
544 $ hg clone -U deeprepo-basicstore local-clone-basicstore
552 $ hg clone -U deeprepo-basicstore local-clone-basicstore
@@ -566,3 +574,55 b' Local clone with fncachestore'
566 crosschecking files in changesets and manifests
574 crosschecking files in changesets and manifests
567 checking files
575 checking files
568 8 files, 3 changesets, 10 total revisions
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