mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Keep status output format consistents (#4490)
fix#4482 According to the discussion. Make `DVC status [outputs]` output format the same with `DVC status [stages]` instead of `DVC status -c [outputs]`
This commit is contained in:
+3
-5
@@ -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
|
||||
|
||||
|
||||
@@ -469,13 +469,13 @@ class Stage(params.StageParams):
|
||||
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 {}
|
||||
@@ -494,8 +494,9 @@ class Stage(params.StageParams):
|
||||
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})
|
||||
|
||||
|
||||
@@ -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"}}]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user