changeset 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
files hgext/largefiles/lfcommands.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/lfcommands.py	Fri Sep 11 10:47:17 2020 +0900
+++ b/hgext/largefiles/lfcommands.py	Sun Sep 13 17:43:19 2020 +0900
@@ -486,15 +486,11 @@
 
 
 def downloadlfiles(ui, repo):
-    match = scmutil.match(repo[None], [repo.wjoin(lfutil.shortname)], {})
-
-    def prepare(ctx, fns):
-        pass
-
+    tonode = repo.changelog.node
     totalsuccess = 0
     totalmissing = 0
-    for ctx in cmdutil.walkchangerevs(repo, match, {b'rev': None}, prepare):
-        success, missing = cachelfiles(ui, repo, ctx.node())
+    for rev in repo.revs(b'reverse(file(%s))', b'path:' + lfutil.shortname):
+        success, missing = cachelfiles(ui, repo, tonode(rev))
         totalsuccess += len(success)
         totalmissing += len(missing)
     ui.status(_(b"%d additional largefiles cached\n") % totalsuccess)