From b736a66c2e797ac9aa8c6f0a1d80c3c547529440 Mon Sep 17 00:00:00 2001 From: tenitski Date: Sun, 11 Oct 2020 17:12:44 +1300 Subject: [PATCH 1/3] #1618 Custom message when cache and remote are in sync --- dvc/command/status.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dvc/command/status.py b/dvc/command/status.py index 75cbd9565f..7ecd4b3568 100644 --- a/dvc/command/status.py +++ b/dvc/command/status.py @@ -11,6 +11,7 @@ class CmdDataStatus(CmdDataBase): STATUS_LEN = 20 STATUS_INDENT = "\t" UP_TO_DATE_MSG = "Data and pipelines are up to date." + IN_SYNC_MSG = "Cache and remote '{remote}' are in sync." EMPTY_PROJECT_MSG = ( "There are no data or pipelines tracked in this project yet.\n" "See {link} to get started!" @@ -68,6 +69,12 @@ def run(self): self._show(st, indent) elif not self.repo.stages: logger.info(self.EMPTY_PROJECT_MSG) + elif self.args.cloud or self.args.remote: + logger.info( + self.IN_SYNC_MSG.format( + remote=self.repo.config["core"].get("remote") + ) + ) else: logger.info(self.UP_TO_DATE_MSG) From 256dcce6a436b3fd8a10ae76605780824db9992f Mon Sep 17 00:00:00 2001 From: tenitski Date: Mon, 12 Oct 2020 08:29:38 +1300 Subject: [PATCH 2/3] Output the correct remote name during dvc status --- dvc/command/status.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dvc/command/status.py b/dvc/command/status.py index 7ecd4b3568..5f6b55b4d7 100644 --- a/dvc/command/status.py +++ b/dvc/command/status.py @@ -69,12 +69,14 @@ def run(self): self._show(st, indent) elif not self.repo.stages: logger.info(self.EMPTY_PROJECT_MSG) - elif self.args.cloud or self.args.remote: + elif self.args.cloud: logger.info( self.IN_SYNC_MSG.format( remote=self.repo.config["core"].get("remote") ) ) + elif self.args.remote: + logger.info(self.IN_SYNC_MSG.format(remote=self.args.remote)) else: logger.info(self.UP_TO_DATE_MSG) From 2bbfe810c07b2cec52c4c5d680c87b2f8fb5c36c Mon Sep 17 00:00:00 2001 From: tenitski Date: Mon, 12 Oct 2020 09:00:18 +1300 Subject: [PATCH 3/3] Simplify logic --- dvc/command/status.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dvc/command/status.py b/dvc/command/status.py index 5f6b55b4d7..8d24960504 100644 --- a/dvc/command/status.py +++ b/dvc/command/status.py @@ -69,14 +69,11 @@ def run(self): self._show(st, indent) elif not self.repo.stages: logger.info(self.EMPTY_PROJECT_MSG) - elif self.args.cloud: - logger.info( - self.IN_SYNC_MSG.format( - remote=self.repo.config["core"].get("remote") - ) + elif self.args.cloud or self.args.remote: + remote = self.args.remote or self.repo.config["core"].get( + "remote" ) - elif self.args.remote: - logger.info(self.IN_SYNC_MSG.format(remote=self.args.remote)) + logger.info(self.IN_SYNC_MSG.format(remote=remote)) else: logger.info(self.UP_TO_DATE_MSG)