Comments
Patch
@@ -50,11 +50,13 @@
largefiles).
If you want to pull largefiles you don't need for update yet, then
-you can use the `lfpull` command.
+you can use pull with the `--lfrev` option or the :hg:`lfpull` command.
If you just want to ensure that you will have the largefiles needed to
merge or rebase with new heads that you are pulling, then you can pull
-with `--cache-largefiles` flag to pre-emptively download any largefiles
+with `--lfrev "head(0:)"` flag to pre-emptively download any largefiles
+that are in the heads after pulling. You can also pull with the
+`--cache-largefiles` flag to pre-emptively download any largefiles
that are new in the heads you are pulling.
Keep in mind that network access may now be required to update to
@@ -753,6 +753,14 @@
for rev in xrange(revsprepull, revspostpull):
revs.append(repo[rev].rev())
lfcommands.downloadlfiles(ui, repo, revs)
+ lfrevs = opts.get('lfrev', [])
+ if lfrevs and revspostpull > revsprepull:
+ numcached = 0
+ for rev in scmutil.revrange(repo, lfrevs):
+ ui.note(_('pulling largefiles for revision %s\n') % rev)
+ (cached, missing) = lfcommands.cachelfiles(ui, repo, rev)
+ numcached += len(cached)
+ ui.status(_("%d largefiles cached\n") % numcached)
return result
def overrideclone(orig, ui, source, dest=None, **opts):
@@ -81,7 +81,9 @@
pullopt = [('', 'all-largefiles', None,
_('download all pulled versions of largefiles')),
('', 'cache-largefiles', None,
- _('caches new largefiles in all pulled heads'))]
+ _('caches new largefiles in all pulled heads')),
+ ('', 'lfrev', [],
+ _('download largefiles for these revisions'), _('REV'))]
entry[1].extend(pullopt)
entry = extensions.wrapcommand(commands.table, 'clone',
overrides.overrideclone)
@@ -885,6 +885,27 @@
(run 'hg update' to get a working copy)
6 additional largefiles cached
+redo pull with --lfrev and check it pulls largefiles for the right revs
+
+ $ hg rollback
+ repository tip rolled back to revision 1 (undo pull)
+ $ hg pull -v --lfrev 'heads(0:)'
+ pulling from $TESTTMP/a (glob)
+ searching for changes
+ all local heads known remotely
+ 6 changesets found
+ adding changesets
+ adding manifests
+ adding file changes
+ added 6 changesets with 16 changes to 8 files
+ calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob)
+ (run 'hg update' to get a working copy)
+ pulling largefiles for revision 7
+ found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
+ found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
+ found bb3151689acb10f0c3125c560d5e63df914bc1af in store
+ 0 largefiles cached
+
lfpull
$ hg lfpull -r : --config largefiles.usercache=usercache-lfpull