##// END OF EJS Templates
largefiles: add --all-largefiles flag to clone (issue3188)
Na'Tosha Bard -
r16644:98a9266d default
parent child Browse files
Show More
@@ -697,6 +697,33 b' def overridepull(orig, ui, repo, source='
697 ui.status(_("%d largefiles cached\n") % numcached)
697 ui.status(_("%d largefiles cached\n") % numcached)
698 return result
698 return result
699
699
700 def overrideclone(orig, ui, source, dest=None, **opts):
701 result = hg.clone(ui, opts, source, dest,
702 pull=opts.get('pull'),
703 stream=opts.get('uncompressed'),
704 rev=opts.get('rev'),
705 update=True, # required for successful walkchangerevs
706 branch=opts.get('branch'))
707 if result is None:
708 return True
709 totalsuccess = 0
710 totalmissing = 0
711 if opts.get('all_largefiles'):
712 sourcerepo, destrepo = result
713 matchfn = scmutil.match(destrepo[None],
714 [destrepo.wjoin(lfutil.shortname)], {})
715 def prepare(ctx, fns):
716 pass
717 for ctx in cmdutil.walkchangerevs(destrepo, matchfn, {'rev' : None},
718 prepare):
719 success, missing = lfcommands.cachelfiles(ui, destrepo, ctx.node())
720 totalsuccess += len(success)
721 totalmissing += len(missing)
722 ui.status(_("%d additional largefiles cached\n") % totalsuccess)
723 if totalmissing > 0:
724 ui.status(_("%d largefiles failed to download\n") % totalmissing)
725 return totalmissing != 0
726
700 def overriderebase(orig, ui, repo, **opts):
727 def overriderebase(orig, ui, repo, **opts):
701 repo._isrebasing = True
728 repo._isrebasing = True
702 try:
729 try:
@@ -70,6 +70,12 b' def uisetup(ui):'
70 overrides.overrideupdate)
70 overrides.overrideupdate)
71 entry = extensions.wrapcommand(commands.table, 'pull',
71 entry = extensions.wrapcommand(commands.table, 'pull',
72 overrides.overridepull)
72 overrides.overridepull)
73 entry = extensions.wrapcommand(commands.table, 'clone',
74 overrides.overrideclone)
75 cloneopt = [('', 'all-largefiles', None,
76 _('download all versions of all largefiles'))]
77
78 entry[1].extend(cloneopt)
73 entry = extensions.wrapcommand(commands.table, 'cat',
79 entry = extensions.wrapcommand(commands.table, 'cat',
74 overrides.overridecat)
80 overrides.overridecat)
75 entry = extensions.wrapfunction(merge, '_checkunknownfile',
81 entry = extensions.wrapfunction(merge, '_checkunknownfile',
@@ -432,11 +432,21 b' tests update).'
432 large11
432 large11
433 $ cat sub/large2
433 $ cat sub/large2
434 large22
434 large22
435 $ cd ..
436
437 Test cloning with --all-largefiles flag
438
439 $ rm -Rf ${USERCACHE}/*
440 $ hg clone --all-largefiles a a-backup
441 updating to branch default
442 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 getting changed largefiles
444 3 largefiles updated, 0 removed
445 8 additional largefiles cached
435
446
436 Rebasing between two repositories does not revert largefiles to old
447 Rebasing between two repositories does not revert largefiles to old
437 revisions (this was a very bad bug that took a lot of work to fix).
448 revisions (this was a very bad bug that took a lot of work to fix).
438
449
439 $ cd ..
440 $ hg clone a d
450 $ hg clone a d
441 updating to branch default
451 updating to branch default
442 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
452 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now