Mercurial > hg
comparison hgext/largefiles/lfcommands.py @ 45454:ac7b9ed0a245
largefiles: replace use of walkchangerevs() with simple revset query
Since it does nothing in prepare(), what we're doing is just walking
revisions matching ".hglf" in reverse order.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 13 Sep 2020 17:43:19 +0900 |
parents | 39ddb1121c4e |
children | b0d45612c552 |
comparison
equal
deleted
inserted
replaced
45453:39ddb1121c4e | 45454:ac7b9ed0a245 |
---|---|
484 | 484 |
485 return ([], []) | 485 return ([], []) |
486 | 486 |
487 | 487 |
488 def downloadlfiles(ui, repo): | 488 def downloadlfiles(ui, repo): |
489 match = scmutil.match(repo[None], [repo.wjoin(lfutil.shortname)], {}) | 489 tonode = repo.changelog.node |
490 | |
491 def prepare(ctx, fns): | |
492 pass | |
493 | |
494 totalsuccess = 0 | 490 totalsuccess = 0 |
495 totalmissing = 0 | 491 totalmissing = 0 |
496 for ctx in cmdutil.walkchangerevs(repo, match, {b'rev': None}, prepare): | 492 for rev in repo.revs(b'reverse(file(%s))', b'path:' + lfutil.shortname): |
497 success, missing = cachelfiles(ui, repo, ctx.node()) | 493 success, missing = cachelfiles(ui, repo, tonode(rev)) |
498 totalsuccess += len(success) | 494 totalsuccess += len(success) |
499 totalmissing += len(missing) | 495 totalmissing += len(missing) |
500 ui.status(_(b"%d additional largefiles cached\n") % totalsuccess) | 496 ui.status(_(b"%d additional largefiles cached\n") % totalsuccess) |
501 if totalmissing > 0: | 497 if totalmissing > 0: |
502 ui.status(_(b"%d largefiles failed to download\n") % totalmissing) | 498 ui.status(_(b"%d largefiles failed to download\n") % totalmissing) |