push/fetch: respect --jobs on worktree push/fetch

This commit is contained in:
Peter Rowlands
2023-01-10 16:21:31 +09:00
committed by Peter Rowlands (변기호)
parent 6ac88104da
commit d3d429ef7f
3 changed files with 12 additions and 3 deletions
+5 -1
View File
@@ -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
+3 -1
View File
@@ -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)
+4 -1
View File
@@ -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: