##// END OF EJS Templates
largefiles: don't cache largefiles for pulled heads by default...
Na'Tosha Bard -
r18704:d69585a5 default
parent child Browse files
Show More
@@ -41,13 +41,17 b' Note that the remote Mercurial must also'
41 enabled for this to work.
41 enabled for this to work.
42
42
43 When you pull a changeset that affects largefiles from a remote
43 When you pull a changeset that affects largefiles from a remote
44 repository, the largefiles for the changeset usually won't be
44 repository, the largefiles for the changeset won't be pulled down.
45 pulled down until you update to the revision (there is one exception
45 Instead, when you later update to such a revision, any largefiles
46 to this case). However, when you update to such a revision, any
46 needed by that revision are downloaded and cached (if they have
47 largefiles needed by that revision are downloaded and cached (if
47 never been downloaded before). This means that network access may
48 they have never been downloaded before). This means that network
48 be required to update to changesets you have previously updated to.
49 access may be required to update to changesets you have no
49
50 previously updated to.
50 If you know you are pulling from a non-default location and want to
51 ensure that you will have the largefiles needed to merge or rebase
52 with new heads that you are pulling, then you can pull with the
53 --cache-largefiles flag to pre-emptively download any largefiles
54 that are new in the heads you are pulling.
51
55
52 The one exception to the "largefiles won't be pulled until you update
56 The one exception to the "largefiles won't be pulled until you update
53 to a revision that changes them" rule is when you pull new heads.
57 to a revision that changes them" rule is when you pull new heads.
@@ -733,19 +733,21 b' def overridepull(orig, ui, repo, source='
733 repo.lfpullsource = source
733 repo.lfpullsource = source
734 oldheads = lfutil.getcurrentheads(repo)
734 oldheads = lfutil.getcurrentheads(repo)
735 result = orig(ui, repo, source, **opts)
735 result = orig(ui, repo, source, **opts)
736 # If we do not have the new largefiles for any new heads we pulled, we
736 if opts.get('cache_largefiles'):
737 # will run into a problem later if we try to merge or rebase with one of
737 # If you are pulling from a remote location that is not your
738 # these heads, so cache the largefiles now directly into the system
738 # default location, you may want to cache largefiles for new heads
739 # cache.
739 # that have been pulled, so you can easily merge or rebase with
740 numcached = 0
740 # them later
741 heads = lfutil.getcurrentheads(repo)
741 numcached = 0
742 newheads = set(heads).difference(set(oldheads))
742 heads = lfutil.getcurrentheads(repo)
743 if len(newheads) > 0:
743 newheads = set(heads).difference(set(oldheads))
744 ui.status(_("caching largefiles for %s heads\n") % len(newheads))
744 if len(newheads) > 0:
745 for head in newheads:
745 ui.status(_("caching largefiles for %s heads\n") %
746 (cached, missing) = lfcommands.cachelfiles(ui, repo, head)
746 len(newheads))
747 numcached += len(cached)
747 for head in newheads:
748 ui.status(_("%d largefiles cached\n") % numcached)
748 (cached, missing) = lfcommands.cachelfiles(ui, repo, head)
749 numcached += len(cached)
750 ui.status(_("%d largefiles cached\n") % numcached)
749 if opts.get('all_largefiles'):
751 if opts.get('all_largefiles'):
750 revspostpull = len(repo)
752 revspostpull = len(repo)
751 revs = []
753 revs = []
@@ -79,7 +79,9 b' def uisetup(ui):'
79 entry = extensions.wrapcommand(commands.table, 'pull',
79 entry = extensions.wrapcommand(commands.table, 'pull',
80 overrides.overridepull)
80 overrides.overridepull)
81 pullopt = [('', 'all-largefiles', None,
81 pullopt = [('', 'all-largefiles', None,
82 _('download all pulled versions of largefiles'))]
82 _('download all pulled versions of largefiles')),
83 ('', 'cache-largefiles', None,
84 _('caches new largefiles in all pulled heads'))]
83 entry[1].extend(pullopt)
85 entry[1].extend(pullopt)
84 entry = extensions.wrapcommand(commands.table, 'clone',
86 entry = extensions.wrapcommand(commands.table, 'clone',
85 overrides.overrideclone)
87 overrides.overrideclone)
@@ -37,8 +37,6 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 largefiles for 1 heads
41 0 largefiles cached
42
40
43 Update working directory to "tip", which requires largefile("large"),
41 Update working directory to "tip", which requires largefile("large"),
44 but there is no cache file for it. So, hg must treat it as
42 but there is no cache file for it. So, hg must treat it as
@@ -883,9 +883,7 b" downloaded from 'default' instead of 'de"
883 adding file changes
883 adding file changes
884 added 6 changesets with 16 changes to 8 files
884 added 6 changesets with 16 changes to 8 files
885 (run 'hg update' to get a working copy)
885 (run 'hg update' to get a working copy)
886 caching largefiles for 1 heads
886 6 additional largefiles cached
887 3 largefiles cached
888 3 additional largefiles cached
889 $ cd ..
887 $ cd ..
890
888
891 Rebasing between two repositories does not revert largefiles to old
889 Rebasing between two repositories does not revert largefiles to old
@@ -974,8 +972,6 b" The error messages go away if repo 'b' i"
974 adding file changes
972 adding file changes
975 added 1 changesets with 2 changes to 2 files (+1 heads)
973 added 1 changesets with 2 changes to 2 files (+1 heads)
976 (run 'hg heads' to see heads, 'hg merge' to merge)
974 (run 'hg heads' to see heads, 'hg merge' to merge)
977 caching largefiles for 1 heads
978 0 largefiles cached
979 $ hg rebase
975 $ hg rebase
980 Invoking status precommit hook
976 Invoking status precommit hook
981 M sub/normal4
977 M sub/normal4
@@ -1265,7 +1261,8 b' correctly.'
1265 $ hg commit -m "Modify large4 to test merge"
1261 $ hg commit -m "Modify large4 to test merge"
1266 Invoking status precommit hook
1262 Invoking status precommit hook
1267 M sub/large4
1263 M sub/large4
1268 $ hg pull ../e
1264 # Test --cache-largefiles flag
1265 $ hg pull --cache-largefiles ../e
1269 pulling from ../e
1266 pulling from ../e
1270 searching for changes
1267 searching for changes
1271 adding changesets
1268 adding changesets
General Comments 0
You need to be logged in to leave comments. Login now