mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 07:18:28 +01:00
output: drop update() method
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+3
-7
@@ -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)
|
||||
|
||||
|
||||
+1
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user