Bugfix: checkout - handle files with missing caches

This commit is contained in:
Dmitry
2018-01-07 00:54:09 -08:00
parent 0a2660513e
commit 0b46fc25fb
+6 -1
View File
@@ -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)