From e4f83cb1f8e54b434832db4bcecc28cad4d5dc32 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 6 Feb 2018 14:33:21 +0200 Subject: [PATCH] output: drop update() method Signed-off-by: Ruslan Kuprieiev --- dvc/output.py | 10 +++------- dvc/stage.py | 3 +-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/dvc/output.py b/dvc/output.py index b602cd7e3..58034769d 100644 --- a/dvc/output.py +++ b/dvc/output.py @@ -90,7 +90,7 @@ class Dependency(object): def inode(self): return os.stat(self.path).st_ino - def update(self): + def save(self): if not os.path.exists(self.path): raise CmdOutputDoesNotExistError(self.rel_path) @@ -239,17 +239,13 @@ class Output(Dependency): self.hardlink(cache, path) def save(self): + super(Output, self).save() + if not self.use_cache: return self.project.logger.debug("Saving {} to {}".format(self.path, self.cache)) - if not os.path.exists(self.path): - raise CmdOutputDoesNotExistError(self.rel_path) - - if not os.path.isfile(self.path) and not os.path.isdir(self.path): - raise CmdOutputIsNotFileOrDirError(self.rel_path) - if self.project.scm.is_tracked(self.path): raise CmdOutputAlreadyTrackedError(self.rel_path) diff --git a/dvc/stage.py b/dvc/stage.py index cb32c874c..5eba993f1 100644 --- a/dvc/stage.py +++ b/dvc/stage.py @@ -149,10 +149,9 @@ class Stage(object): def save(self): for dep in self.deps: - dep.update() + dep.save() for out in self.outs: - out.update() out.save() if out.use_cache: self.project.scm.ignore(out.path)