Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions dvc/repo/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ def _joint_status(pairs):
"{} is frozen. Its dependencies are"
" not going to be shown in the status output.".format(stage)
)
if not filter_info:
status_info.update(stage.status(check_updates=True))
else:
for out in stage.filter_outs(filter_info):
status_info.update(out.status())
status_info.update(
stage.status(check_updates=True, filter_info=filter_info)
)

return status_info

Expand Down
9 changes: 5 additions & 4 deletions dvc/stage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,13 @@ def _checkout(out, **kwargs):
return "failed", exc.target_infos

@rwlocked(read=["deps", "outs"])
def status(self, check_updates=False):
def status(self, check_updates=False, filter_info=None):
ret = []
show_import = self.is_repo_import and check_updates

if not self.frozen or show_import:
self._status_deps(ret)
self._status_outs(ret)
self._status_outs(ret, filter_info=filter_info)
self._status_always_changed(ret)
self._status_stage(ret)
return {self.addressing: ret} if ret else {}
Expand All @@ -494,8 +494,9 @@ def _status_deps(self, ret):
if deps_status:
ret.append({"changed deps": deps_status})

def _status_outs(self, ret):
outs_status = self._status(self.outs)
def _status_outs(self, ret, filter_info):
filter_outs = self.filter_outs(filter_info)
outs_status = self._status(filter_outs)
if outs_status:
ret.append({"changed outs": outs_status})

Expand Down
4 changes: 3 additions & 1 deletion tests/func/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@ def test_status_outputs(tmp_dir, dvc):
]
}

assert dvc.status(targets=["alice"]) == {"alice": "modified"}
assert dvc.status(targets=["alice"]) == {
"alice_bob": [{"changed outs": {"alice": "modified"}}]
}