diff --git a/dvc/stage.py b/dvc/stage.py index dcad68e9b..667164878 100644 --- a/dvc/stage.py +++ b/dvc/stage.py @@ -125,7 +125,12 @@ class Output(object): def checkout(self): if not self.use_cache: return - self.link(checkout=True) + if not os.path.exists(self.cache): + self.project.logger.warn(u'\'{}\': cache file not found'.format(self.dvc_path)) + if os.path.exists(self.path): + os.unlink(self.path) + else: + self.link(checkout=True) def mtime(self): return os.path.getmtime(self.path)