Skip to content

Commit

Permalink
data: status: get rid of --not-in-remote
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop committed Feb 21, 2023
1 parent 968a8fd commit 37761a2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
7 changes: 0 additions & 7 deletions dvc/commands/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def run(self) -> int:
status = self.repo.data_status(
granular=self.args.granular,
untracked_files=self.args.untracked_files,
not_in_remote=self.args.not_in_remote,
remote_refresh=self.args.remote_refresh,
)

Expand Down Expand Up @@ -244,12 +243,6 @@ def add_parser(subparsers, parent_parser):
nargs="?",
help="Show untracked files.",
)
data_status_parser.add_argument(
"--not-in-remote",
action="store_true",
default=False,
help="Show files missing from remote.",
)
data_status_parser.add_argument(
"--remote-refresh",
action="store_true",
Expand Down
3 changes: 1 addition & 2 deletions dvc/repo/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def _diff_index_to_wtree(repo: "Repo", **kwargs: Any) -> Dict[str, List[str]]:
repo.index.data["repo"],
workspace,
not_in_cache=True,
not_in_remote=True,
**kwargs,
)

Expand Down Expand Up @@ -223,15 +224,13 @@ def _transform_git_paths_to_dvc(repo: "Repo", files: Iterable[str]) -> List[str]
def status(
repo: "Repo",
untracked_files: str = "no",
not_in_remote: bool = False,
**kwargs: Any,
) -> Status:
from dvc.scm import NoSCMError, SCMError

head = kwargs.pop("head", "HEAD")
uncommitted_diff = _diff_index_to_wtree(
repo,
not_in_remote=not_in_remote,
**kwargs,
)
unchanged = set(uncommitted_diff.pop("unchanged", []))
Expand Down
6 changes: 2 additions & 4 deletions tests/func/test_data_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,17 +402,15 @@ def test_missing_remote_cache(M, tmp_dir, dvc, scm, local_remote):
tmp_dir.dvc_gen({"dir": {"foo": "foo", "bar": "bar"}})
tmp_dir.dvc_gen("foobar", "foobar")

assert dvc.data_status(untracked_files="all", not_in_remote=True) == {
assert dvc.data_status(untracked_files="all") == {
**EMPTY_STATUS,
"untracked": M.unordered("foobar.dvc", "dir.dvc", ".gitignore"),
"committed": {"added": M.unordered("foobar", join("dir", ""))},
"not_in_remote": M.unordered("foobar", join("dir", "")),
"git": M.dict(),
}

assert dvc.data_status(
granular=True, untracked_files="all", not_in_remote=True
) == {
assert dvc.data_status(granular=True, untracked_files="all") == {
**EMPTY_STATUS,
"untracked": M.unordered("foobar.dvc", "dir.dvc", ".gitignore"),
"committed": {
Expand Down
1 change: 0 additions & 1 deletion tests/unit/command/test_data_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def test_cli(dvc, mocker, mocked_status):
assert cmd.run() == 0
status.assert_called_once_with(
untracked_files="all",
not_in_remote=False,
remote_refresh=False,
granular=True,
)
Expand Down

0 comments on commit 37761a2

Please sign in to comment.