##// END OF EJS Templates
largefiles: cache new largefiles for new heads when pulling...
Na'Tosha Bard -
r15916:c9614834 default
parent child Browse files
Show More
@@ -658,6 +658,19 b' def override_pull(orig, ui, repo, source'
658 if not source:
658 if not source:
659 source = 'default'
659 source = 'default'
660 result = orig(ui, repo, source, **opts)
660 result = orig(ui, repo, source, **opts)
661 # If we do not have the new largefiles for any new heads we pulled, we
662 # will run into a problem later if we try to merge or rebase with one of
663 # these heads, so cache the largefiles now direclty into the system
664 # cache.
665 ui.status(_("caching new largefiles\n"))
666 numcached = 0
667 branches = repo.branchmap()
668 for branch in branches:
669 heads = repo.branchheads(branch)
670 for head in heads:
671 (cached, missing) = lfcommands.cachelfiles(ui, repo, head)
672 numcached += len(cached)
673 ui.status(_("%d largefiles cached\n" % numcached))
661 return result
674 return result
662
675
663 def override_rebase(orig, ui, repo, **opts):
676 def override_rebase(orig, ui, repo, **opts):
@@ -37,6 +37,8 b' repo as "default" path in .hg/hgrc.'
37 adding file changes
37 adding file changes
38 added 1 changesets with 1 changes to 1 files
38 added 1 changesets with 1 changes to 1 files
39 (run 'hg update' to get a working copy)
39 (run 'hg update' to get a working copy)
40 caching new largefiles
41 0 largefiles cached
40
42
41 Update working directory to "tip", which requires largefile("large"),
43 Update working directory to "tip", which requires largefile("large"),
42 but there is no cache file for it. So, hg must treat it as
44 but there is no cache file for it. So, hg must treat it as
@@ -460,6 +460,8 b' revisions (this was a very bad bug that '
460 adding file changes
460 adding file changes
461 added 1 changesets with 2 changes to 2 files (+1 heads)
461 added 1 changesets with 2 changes to 2 files (+1 heads)
462 (run 'hg heads' to see heads, 'hg merge' to merge)
462 (run 'hg heads' to see heads, 'hg merge' to merge)
463 caching new largefiles
464 0 largefiles cached
463 $ hg rebase
465 $ hg rebase
464 getting changed largefiles
466 getting changed largefiles
465 1 largefiles updated, 0 removed
467 1 largefiles updated, 0 removed
@@ -610,11 +612,12 b' revert some files to an older revision'
610 searching 1 changesets for largefiles
612 searching 1 changesets for largefiles
611 verified existence of 3 revisions of 3 largefiles
613 verified existence of 3 revisions of 3 largefiles
612
614
613 Merging does not revert to old versions of largefiles (this has also
615 Merging does not revert to old versions of largefiles and also check
614 been very problematic).
616 that merging after having pulled from a non-default remote works
617 correctly.
615
618
616 $ cd ..
619 $ cd ..
617 $ hg clone -r 7 e f
620 $ hg clone -r 7 e temp
618 adding changesets
621 adding changesets
619 adding manifests
622 adding manifests
620 adding file changes
623 adding file changes
@@ -623,6 +626,14 b' been very problematic).'
623 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
626 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
624 getting changed largefiles
627 getting changed largefiles
625 3 largefiles updated, 0 removed
628 3 largefiles updated, 0 removed
629 $ hg clone temp f
630 updating to branch default
631 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
632 getting changed largefiles
633 3 largefiles updated, 0 removed
634 # Delete the largefiles in the largefiles system cache so that we have an
635 # opportunity to test that caching after a pull works.
636 $ rm ${USERCACHE}/*
626 $ cd f
637 $ cd f
627 $ echo "large4-merge-test" > sub/large4
638 $ echo "large4-merge-test" > sub/large4
628 $ hg commit -m "Modify large4 to test merge"
639 $ hg commit -m "Modify large4 to test merge"
@@ -636,6 +647,8 b' been very problematic).'
636 adding file changes
647 adding file changes
637 added 2 changesets with 4 changes to 4 files (+1 heads)
648 added 2 changesets with 4 changes to 4 files (+1 heads)
638 (run 'hg heads' to see heads, 'hg merge' to merge)
649 (run 'hg heads' to see heads, 'hg merge' to merge)
650 caching new largefiles
651 2 largefiles cached
639 $ hg merge
652 $ hg merge
640 merging sub/large4
653 merging sub/large4
641 largefile sub/large4 has a merge conflict
654 largefile sub/large4 has a merge conflict
General Comments 0
You need to be logged in to leave comments. Login now