##// END OF EJS Templates
largefiles: introduce lfpull command for pulling missing largefiles
Mads Kiilerich -
r18976:6734951e default
parent child Browse files
Show More
@@ -49,6 +49,9 b' when pulling is thus to use --update, wh'
49 copy to the latest pulled revision (and thereby downloading any new
49 copy to the latest pulled revision (and thereby downloading any new
50 largefiles).
50 largefiles).
51
51
52 If you want to pull largefiles you don't need for update yet, then
53 you can use the `lfpull` command.
54
52 If you just want to ensure that you will have the largefiles needed to
55 If you just want to ensure that you will have the largefiles needed to
53 merge or rebase with new heads that you are pulling, then you can pull
56 merge or rebase with new heads that you are pulling, then you can pull
54 with `--cache-largefiles` flag to pre-emptively download any largefiles
57 with `--cache-largefiles` flag to pre-emptively download any largefiles
@@ -530,6 +530,41 b' def _updatelfile(repo, lfdirstate, lfile'
530 lfdirstate.drop(lfile)
530 lfdirstate.drop(lfile)
531 return ret
531 return ret
532
532
533 def lfpull(ui, repo, source="default", **opts):
534 """pull largefiles for the specified revisions from the specified source
535
536 Pull largefiles that are referenced from local changesets but missing
537 locally, pulling from a remote repository to the local cache.
538
539 If SOURCE is omitted, the 'default' path will be used.
540 See :hg:`help urls` for more information.
541
542 .. container:: verbose
543
544 Some examples:
545
546 - pull largefiles for all branch heads::
547
548 hg lfpull -r "head() and not closed()"
549
550 - pull largefiles on the default branch::
551
552 hg lfpull -r "branch(default)"
553 """
554 repo.lfpullsource = source
555
556 revs = opts.get('rev', [])
557 if not revs:
558 raise util.Abort(_('no revisions specified'))
559 revs = scmutil.revrange(repo, revs)
560
561 numcached = 0
562 for rev in revs:
563 ui.note(_('pulling largefiles for revision %s\n') % rev)
564 (cached, missing) = cachelfiles(ui, repo, rev)
565 numcached += len(cached)
566 ui.status(_("%d largefiles cached\n") % numcached)
567
533 # -- hg commands declarations ------------------------------------------------
568 # -- hg commands declarations ------------------------------------------------
534
569
535 cmdtable = {
570 cmdtable = {
@@ -542,6 +577,11 b' cmdtable = {'
542 _('convert from a largefiles repo to a normal repo')),
577 _('convert from a largefiles repo to a normal repo')),
543 ],
578 ],
544 _('hg lfconvert SOURCE DEST [FILE ...]')),
579 _('hg lfconvert SOURCE DEST [FILE ...]')),
580 'lfpull': (lfpull,
581 [('r', 'rev', [], _('pull largefiles for these revisions'))
582 ] + commands.remoteopts,
583 _('-r REV... [-e CMD] [--remotecmd CMD] [SOURCE]')
584 ),
545 }
585 }
546
586
547 commands.inferrepo += " lfconvert"
587 commands.inferrepo += " lfconvert"
@@ -912,6 +912,23 b" downloaded from 'default' instead of 'de"
912 added 6 changesets with 16 changes to 8 files
912 added 6 changesets with 16 changes to 8 files
913 (run 'hg update' to get a working copy)
913 (run 'hg update' to get a working copy)
914 6 additional largefiles cached
914 6 additional largefiles cached
915
916 lfpull
917
918 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
919 2 largefiles cached
920 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
921 pulling largefiles for revision 4
922 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
923 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
924 pulling largefiles for revision 2
925 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
926 0 largefiles cached
927
928 $ ls usercache-lfpull/* | sort
929 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
930 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
931
915 $ cd ..
932 $ cd ..
916
933
917 Rebasing between two repositories does not revert largefiles to old
934 Rebasing between two repositories does not revert largefiles to old
General Comments 0
You need to be logged in to leave comments. Login now