Show More
@@ -11,7 +11,8 b'' | |||
|
11 | 11 | import os |
|
12 | 12 | import shutil |
|
13 | 13 | |
|
14 |
from mercurial import util, match as match_, hg, node, context, error, |
|
|
14 | from mercurial import util, match as match_, hg, node, context, error, \ | |
|
15 | cmdutil, scmutil | |
|
15 | 16 | from mercurial.i18n import _ |
|
16 | 17 | |
|
17 | 18 | import lfutil |
@@ -400,6 +401,23 b' def cachelfiles(ui, repo, node):' | |||
|
400 | 401 | |
|
401 | 402 | return ([], []) |
|
402 | 403 | |
|
404 | def downloadlfiles(ui, repo, rev=None): | |
|
405 | matchfn = scmutil.match(repo[None], | |
|
406 | [repo.wjoin(lfutil.shortname)], {}) | |
|
407 | def prepare(ctx, fns): | |
|
408 | pass | |
|
409 | totalsuccess = 0 | |
|
410 | totalmissing = 0 | |
|
411 | for ctx in cmdutil.walkchangerevs(repo, matchfn, {'rev' : rev}, | |
|
412 | prepare): | |
|
413 | success, missing = cachelfiles(ui, repo, ctx.node()) | |
|
414 | totalsuccess += len(success) | |
|
415 | totalmissing += len(missing) | |
|
416 | ui.status(_("%d additional largefiles cached\n") % totalsuccess) | |
|
417 | if totalmissing > 0: | |
|
418 | ui.status(_("%d largefiles failed to download\n") % totalmissing) | |
|
419 | return totalsuccess, totalmissing | |
|
420 | ||
|
403 | 421 | def updatelfiles(ui, repo, filelist=None, printmessage=True): |
|
404 | 422 | wlock = repo.wlock() |
|
405 | 423 | try: |
@@ -706,23 +706,11 b' def overrideclone(orig, ui, source, dest' | |||
|
706 | 706 | branch=opts.get('branch')) |
|
707 | 707 | if result is None: |
|
708 | 708 | return True |
|
709 | totalsuccess = 0 | |
|
710 | totalmissing = 0 | |
|
711 | 709 | if opts.get('all_largefiles'): |
|
712 | 710 | 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 | |
|
711 | success, missing = lfcommands.downloadlfiles(ui, destrepo, None) | |
|
712 | return missing != 0 | |
|
713 | return result is None | |
|
726 | 714 | |
|
727 | 715 | def overriderebase(orig, ui, repo, **opts): |
|
728 | 716 | repo._isrebasing = True |
General Comments 0
You need to be logged in to leave comments.
Login now