Merge pull request #1056 from efiop/master

repro: print a msg when pipeline is up to date
This commit is contained in:
Ruslan Kuprieiev
2018-08-24 20:08:29 +03:00
committed by GitHub
2 changed files with 10 additions and 3 deletions
+7 -1
View File
@@ -1,6 +1,7 @@
import os
from dvc.command.base import CmdBase
from dvc.command.status import CmdDataStatus
from dvc.exceptions import DvcException
@@ -14,11 +15,16 @@ class CmdRepro(CmdBase):
ret = 0
for target in self.args.targets:
try:
self.project.reproduce(target,
stages = self.project.reproduce(
target,
recursive=recursive,
force=self.args.force,
dry=self.args.dry,
interactive=self.args.interactive)
if len(stages) == 0:
self.project.logger.info(CmdDataStatus.UP_TO_DATE_MSG)
if self.args.metrics:
self.project.metrics_show()
except DvcException as ex:
+3 -2
View File
@@ -4,6 +4,7 @@ from dvc.command.data_sync import CmdDataBase
class CmdDataStatus(CmdDataBase):
STATUS_LEN = 10
STATUS_INDENT = '\t'
UP_TO_DATE_MSG = "Pipeline is up to date. Nothing to reproduce."
def _normalize(self, s):
s += ':'
@@ -32,8 +33,8 @@ class CmdDataStatus(CmdDataBase):
if st:
self._show(st, indent)
else:
self.project.logger.info("Nothing to reproduce. "
"Pipeline is up to date.")
self.project.logger.info(self.UP_TO_DATE_MSG)
except Exception as exc:
self.project.logger.error('Failed to obtain data status', exc)
return 1