[PATCH 1 of 5] largefiles: remove unused 'rev' parameter from downloadlfiles()
Yuya Nishihara
yuya at tcha.org
Sun Sep 13 10:24:11 UTC 2020
# HG changeset patch
# User Yuya Nishihara <yuya at 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."
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
More information about the Mercurial-devel
mailing list