Skip to content

Commit

Permalink
Revert "scm: use dulwich backend when fetching exps during clone/pull" (
Browse files Browse the repository at this point in the history
#9041)

Revert "scm: use dulwich backend when fetching exps during clone/pull (#9023)"

This reverts commit ed1ab7f.
  • Loading branch information
skshetry authored Feb 16, 2023
1 parent 3f0da8f commit d7ea7c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dvc/external_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _pull(git: "Git", unshallow: bool = False):

git.fetch(unshallow=unshallow)
_merge_upstream(git)
fetch_all_exps(git, "origin", backends=["dulwich"])
fetch_all_exps(git, "origin")


def _merge_upstream(git: "Git"):
Expand Down
13 changes: 7 additions & 6 deletions dvc/repo/experiments/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from functools import wraps
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Generator,
Expand Down Expand Up @@ -280,15 +279,17 @@ def check_ref_format(scm: "Git", ref: ExpRefInfo):
)


def fetch_all_exps(
scm: "Git", url: str, progress: Optional[Callable] = None, **kwargs: Any
):
def fetch_all_exps(scm: "Git", url: str, progress: Optional[Callable] = None):
refspecs = [
f"{ref}:{ref}"
for ref in iter_remote_refs(scm, url, base=EXPS_NAMESPACE, **kwargs)
for ref in iter_remote_refs(scm, url, base=EXPS_NAMESPACE)
if not (ref.startswith(EXEC_NAMESPACE) or ref in STASHES)
]
scm.fetch_refspecs(url, refspecs, progress=progress, **kwargs)
scm.fetch_refspecs(
url,
refspecs,
progress=progress,
)


def get_random_exp_name(scm, baseline_rev):
Expand Down
2 changes: 1 addition & 1 deletion dvc/scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def clone(url: str, to_path: str, **kwargs):
try:
git = Git.clone(url, to_path, progress=pbar.update_git, **kwargs)
if "shallow_branch" not in kwargs:
fetch_all_exps(git, url, progress=pbar.update_git, backends=["dulwich"])
fetch_all_exps(git, url, progress=pbar.update_git)
return git
except InternalCloneError as exc:
raise CloneError("SCM error") from exc
Expand Down

0 comments on commit d7ea7c3

Please sign in to comment.