mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 07:18:27 +01:00
data: status: introduce --remote-refresh
This commit is contained in:
@@ -118,6 +118,7 @@ class CmdDataStatus(CmdBase):
|
||||
granular=self.args.granular,
|
||||
untracked_files=self.args.untracked_files,
|
||||
not_in_remote=self.args.not_in_remote,
|
||||
remote_refresh=self.args.remote_refresh,
|
||||
)
|
||||
|
||||
if not self.args.unchanged:
|
||||
@@ -249,6 +250,12 @@ def add_parser(subparsers, parent_parser):
|
||||
default=False,
|
||||
help="Show files missing from remote.",
|
||||
)
|
||||
data_status_parser.add_argument(
|
||||
"--remote-refresh",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Refresh remote index.",
|
||||
)
|
||||
data_status_parser.set_defaults(func=CmdDataStatus)
|
||||
|
||||
DATA_LS_HELP = "List data tracked by DVC with its metadata."
|
||||
|
||||
+4
-1
@@ -60,6 +60,7 @@ def _diff(
|
||||
granular: bool = False,
|
||||
not_in_cache: bool = False,
|
||||
not_in_remote: bool = False,
|
||||
remote_refresh: bool = False,
|
||||
) -> Dict[str, List[str]]:
|
||||
from dvc_data.index import StorageError
|
||||
from dvc_data.index.diff import UNCHANGED, UNKNOWN, diff
|
||||
@@ -109,7 +110,9 @@ def _diff(
|
||||
not_in_remote
|
||||
and change.old
|
||||
and change.old.hash_info
|
||||
and not old.storage_map.remote_exists(change.old)
|
||||
and not old.storage_map.remote_exists(
|
||||
change.old, refresh=remote_refresh
|
||||
)
|
||||
):
|
||||
_add_change("not_in_remote", change)
|
||||
except StorageError:
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ dependencies = [
|
||||
"configobj>=5.0.6",
|
||||
"distro>=1.3",
|
||||
"dpath<3,>=2.0.2",
|
||||
"dvc-data>=0.41.1,<0.42",
|
||||
"dvc-data>=0.41.3,<0.42",
|
||||
"dvc-http",
|
||||
"dvc-render>=0.1.2",
|
||||
"dvc-studio-client>=0.1.1",
|
||||
|
||||
@@ -52,6 +52,7 @@ def test_cli(dvc, mocker, mocked_status):
|
||||
status.assert_called_once_with(
|
||||
untracked_files="all",
|
||||
not_in_remote=False,
|
||||
remote_refresh=False,
|
||||
granular=True,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user