From 79eac34163f82c04ac604988937b58e3fe94a345 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 7 Aug 2018 00:52:59 +0300 Subject: [PATCH] dvc: print more info for add/run/checkout Signed-off-by: Ruslan Kuprieiev --- dvc/remote/local.py | 10 +++++++--- dvc/scm.py | 4 ++++ dvc/stage.py | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dvc/remote/local.py b/dvc/remote/local.py index 1dc6f4073..6c8472e49 100644 --- a/dvc/remote/local.py +++ b/dvc/remote/local.py @@ -239,11 +239,11 @@ class RemoteLOCAL(RemoteBase): if os.path.exists(path): msg = u'Data \'{}\' exists. Removing before checkout' - Logger.debug(msg.format(os.path.relpath(path))) + Logger.warn(msg.format(os.path.relpath(path))) remove(path) - msg = u'Checking out \'{}\' with cache \'{}\'' - Logger.debug(msg.format(os.path.relpath(path), md5)) + msg = u'Checking out \'{}\' with cache \'{}\'.' + Logger.info(msg.format(os.path.relpath(path), md5)) if not self.is_dir_cache(cache): self.link(cache, path) @@ -314,6 +314,10 @@ class RemoteLOCAL(RemoteBase): path = path_info['path'] + msg = "Saving '{}' to cache '{}'." + Logger.info(msg.format(os.path.relpath(path), + os.path.relpath(self.cache_dir))) + if os.path.isdir(path): return self._save_dir(path_info) else: diff --git a/dvc/scm.py b/dvc/scm.py index 6afc00bae..72dc2185c 100644 --- a/dvc/scm.py +++ b/dvc/scm.py @@ -117,6 +117,10 @@ class Git(Base): if len(filtered) != 0: return + msg = "Adding '{}' to '{}'.".format(os.path.relpath(path), + os.path.relpath(gitignore)) + Logger.info(msg) + content = entry if len(ignore_list) > 0: content = '\n' + content diff --git a/dvc/stage.py b/dvc/stage.py index 41de32cbe..ec08b0310 100644 --- a/dvc/stage.py +++ b/dvc/stage.py @@ -292,6 +292,9 @@ class Stage(object): if not fname: fname = self.path + msg = "Saving information to '{}'.".format(os.path.relpath(fname)) + Logger.info(msg) + with open(fname, 'w') as fd: yaml.safe_dump(self.dumpd(), fd, default_flow_style=False)