push: check if versioning is supported or not during checkout on cloud versioning (#8949)Fixes https://github.com/iterative/dvc/issues/8824

* push: check if versioning is supported or not during checkout on cloud versioning

* bump dvc-data to 0.38.4
This commit is contained in:
skshetry
2023-02-08 17:05:27 +05:45
committed by GitHub
parent 9d7883f529
commit 4176007493
2 changed files with 20 additions and 12 deletions
+19 -11
View File
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Set, Tuple, Uni
from funcy import first
from dvc.exceptions import DvcException
from dvc.fs.callbacks import Callback
from dvc.stage.exceptions import StageUpdateError
@@ -144,6 +145,7 @@ def push_worktree(
) -> int:
from dvc.repo.index import build_data_index
from dvc_data.index import checkout
from dvc_data.index.checkout import VersioningNotSupported
pushed = 0
stages: Set["Stage"] = set()
@@ -176,17 +178,23 @@ def push_worktree(
disable=total == 0,
) as cb:
cb.set_size(total)
pushed += checkout(
new_index,
remote_obj.path,
remote_obj.fs,
old=old_index,
delete=remote_obj.worktree,
callback=cb,
latest_only=remote_obj.worktree,
jobs=jobs,
**diff_kwargs,
)
try:
pushed += checkout(
new_index,
remote_obj.path,
remote_obj.fs,
old=old_index,
delete=remote_obj.worktree,
callback=cb,
latest_only=remote_obj.worktree,
jobs=jobs,
**diff_kwargs,
)
except VersioningNotSupported:
logger.exception("")
raise DvcException(
f"remote {remote_obj.name!r} does not support versioning"
) from None
for out in view.outs:
workspace, _key = out.index_key
+1 -1
View File
@@ -53,7 +53,7 @@ dependencies = [
"dvc-render==0.1.1",
"dvc-task==0.1.11",
"dvclive>=1.2.2",
"dvc-data==0.38.3",
"dvc-data==0.38.4",
"dvc-http",
"hydra-core>=1.1.0",
"iterative-telemetry==0.0.7",