From 316ea1d7cbc47273860f0845c08e9c2c48286b78 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Fri, 24 Aug 2018 19:36:45 +0300 Subject: [PATCH] repro: print a msg when pipeline is up to date Fixes #1049 Signed-off-by: Ruslan Kuprieiev --- dvc/command/repro.py | 8 +++++++- dvc/command/status.py | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dvc/command/repro.py b/dvc/command/repro.py index 7a8ad0955..284174b6d 100644 --- a/dvc/command/repro.py +++ b/dvc/command/repro.py @@ -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: diff --git a/dvc/command/status.py b/dvc/command/status.py index 2dfe7c7cd..3afeef566 100644 --- a/dvc/command/status.py +++ b/dvc/command/status.py @@ -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