diff --git a/dvc/repo/fetch.py b/dvc/repo/fetch.py index 924a57737..997068322 100644 --- a/dvc/repo/fetch.py +++ b/dvc/repo/fetch.py @@ -78,6 +78,7 @@ def fetch( all_tags=all_tags, all_commits=all_commits, targets=targets, + jobs=jobs, with_deps=with_deps, recursive=recursive, ) @@ -181,6 +182,7 @@ def _fetch_worktree( all_tags: bool = False, all_commits: bool = False, targets: Optional["TargetType"] = None, + jobs: Optional[int] = None, **kwargs, ) -> int: from dvc.repo.worktree import fetch_worktree @@ -192,5 +194,7 @@ def _fetch_worktree( all_tags=all_tags, all_commits=all_commits, ): - downloaded += fetch_worktree(repo, remote, targets=targets, **kwargs) + downloaded += fetch_worktree( + repo, remote, targets=targets, jobs=jobs, **kwargs + ) return downloaded diff --git a/dvc/repo/push.py b/dvc/repo/push.py index 61ad34d4d..719649449 100644 --- a/dvc/repo/push.py +++ b/dvc/repo/push.py @@ -55,6 +55,7 @@ def push( all_tags=all_tags, all_commits=all_commits, targets=expanded_targets, + jobs=jobs, with_deps=with_deps, recursive=recursive, ) @@ -105,6 +106,7 @@ def _push_worktree( all_tags: bool = False, all_commits: bool = False, targets: Optional["TargetType"] = None, + jobs: Optional[int] = None, **kwargs, ) -> int: from dvc.repo.worktree import push_worktree @@ -114,4 +116,4 @@ def _push_worktree( "Multiple rev push is unsupported for cloud versioned remotes" ) - return push_worktree(repo, remote, targets=targets, **kwargs) + return push_worktree(repo, remote, targets=targets, jobs=jobs, **kwargs) diff --git a/dvc/repo/worktree.py b/dvc/repo/worktree.py index cf5af4850..c7461fcb4 100644 --- a/dvc/repo/worktree.py +++ b/dvc/repo/worktree.py @@ -74,6 +74,7 @@ def fetch_worktree( repo: "Repo", remote: "Remote", targets: Optional["TargetType"] = None, + jobs: Optional[int] = None, **kwargs, ) -> int: from dvc_data.index import save @@ -91,13 +92,14 @@ def fetch_worktree( unit="file", desc="Fetch", disable=total == 0 ) as cb: cb.set_size(total) - return save(index, callback=cb) + return save(index, callback=cb, jobs=jobs) def push_worktree( repo: "Repo", remote: "Remote", targets: Optional["TargetType"] = None, + jobs: Optional[int] = None, **kwargs, ) -> int: from dvc_data.index import checkout @@ -139,6 +141,7 @@ def push_worktree( delete=remote.worktree, callback=cb, latest_only=remote.worktree, + jobs=jobs, **diff_kwargs, ) if pushed: