Patchwork [1,of,5] largefiles: remove unused 'rev' parameter from downloadlfiles()

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 13, 2020, 10:24 a.m.
Message ID <ff5371cc36edbe4bce8f.1599992651@mimosa>
Download mbox | patch
Permalink /patch/47149/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 13, 2020, 10:24 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1599788837 -32400
#      Fri Sep 11 10:47:17 2020 +0900
# Node ID ff5371cc36edbe4bce8f0bb8514763ced1c8da6e
# Parent  4668766a0dac96ceb1fa27e32890889a893d5695
largefiles: remove unused 'rev' parameter from downloadlfiles()

It's no longer used since 83ead8cb0ff2 "largefiles: implement pull
--all-largefiles as a special case of --lfrev."
Pulkit Goyal - Sept. 14, 2020, 7:13 a.m.
On Sun, Sep 13, 2020 at 3:57 PM Yuya Nishihara <yuya@tcha.org> wrote:
>
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1599788837 -32400
> #      Fri Sep 11 10:47:17 2020 +0900
> # Node ID ff5371cc36edbe4bce8f0bb8514763ced1c8da6e
> # Parent  4668766a0dac96ceb1fa27e32890889a893d5695
> largefiles: remove unused 'rev' parameter from downloadlfiles()
>
> It's no longer used since 83ead8cb0ff2 "largefiles: implement pull
> --all-largefiles as a special case of --lfrev."

Queued the series, many thanks!

Patch

diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -485,7 +485,7 @@  def cachelfiles(ui, repo, node, filelist
     return ([], [])
 
 
-def downloadlfiles(ui, repo, rev=None):
+def downloadlfiles(ui, repo):
     match = scmutil.match(repo[None], [repo.wjoin(lfutil.shortname)], {})
 
     def prepare(ctx, fns):
@@ -493,11 +493,10 @@  def downloadlfiles(ui, repo, rev=None):
 
     totalsuccess = 0
     totalmissing = 0
-    if rev != []:  # walkchangerevs on empty list would return all revs
-        for ctx in cmdutil.walkchangerevs(repo, match, {b'rev': rev}, prepare):
-            success, missing = cachelfiles(ui, repo, ctx.node())
-            totalsuccess += len(success)
-            totalmissing += len(missing)
+    for ctx in cmdutil.walkchangerevs(repo, match, {b'rev': None}, prepare):
+        success, missing = cachelfiles(ui, repo, ctx.node())
+        totalsuccess += len(success)
+        totalmissing += len(missing)
     ui.status(_(b"%d additional largefiles cached\n") % totalsuccess)
     if totalmissing > 0:
         ui.status(_(b"%d largefiles failed to download\n") % totalmissing)
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1094,7 +1094,7 @@  def hgclone(orig, ui, opts, *args, **kwa
         # truncated at that point.  The user may expect a download count with
         # this option, so attempt whether or not this is a largefile repo.
         if opts.get(b'all_largefiles'):
-            success, missing = lfcommands.downloadlfiles(ui, repo, None)
+            success, missing = lfcommands.downloadlfiles(ui, repo)
 
             if missing != 0:
                 return None