From d7ea7c358da530df33c6d7a4371fec7497254f07 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Thu, 16 Feb 2023 18:07:45 +0545 Subject: [PATCH] Revert "scm: use dulwich backend when fetching exps during clone/pull" (#9041) Revert "scm: use dulwich backend when fetching exps during clone/pull (#9023)" This reverts commit ed1ab7fa753e442c1ab26cf2d1eb4a194efd83cf. --- dvc/external_repo.py | 2 +- dvc/repo/experiments/utils.py | 13 +++++++------ dvc/scm.py | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dvc/external_repo.py b/dvc/external_repo.py index 97c36ccbdd..e273209c99 100644 --- a/dvc/external_repo.py +++ b/dvc/external_repo.py @@ -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"): diff --git a/dvc/repo/experiments/utils.py b/dvc/repo/experiments/utils.py index 4bd0759dd1..e8ed3ba97a 100644 --- a/dvc/repo/experiments/utils.py +++ b/dvc/repo/experiments/utils.py @@ -5,7 +5,6 @@ from functools import wraps from typing import ( TYPE_CHECKING, - Any, Callable, Dict, Generator, @@ -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): diff --git a/dvc/scm.py b/dvc/scm.py index 04e93767be..0c0c9e838d 100644 --- a/dvc/scm.py +++ b/dvc/scm.py @@ -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