stage: split save() into save() + commit()

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2019-02-16 21:18:26 +02:00
parent bbd27527ff
commit 0eab7ed29e
4 changed files with 9 additions and 1 deletions
+3
View File
@@ -138,6 +138,8 @@ class OutputBase(object):
def save(self):
self.info = self.remote.save_info(self.path_info)
def commit(self):
if self.use_cache:
getattr(self.repo.cache, self.scheme).save(
self.path_info, self.info
@@ -190,6 +192,7 @@ class OutputBase(object):
self.url = out.url
self.path_info = out.path_info
self.save()
self.commit()
if self.scheme == "local" and self.use_cache and self.is_local:
self.repo.scm.ignore(self.path)
-1
View File
@@ -118,4 +118,3 @@ class OutputLOCAL(OutputBase):
self.repo.scm.ignore(self.path)
self.info = self.remote.save_info(self.path_info)
self.project.cache.local.save(self.path_info, self.info)
+1
View File
@@ -30,6 +30,7 @@ def add(self, fname, recursive=False):
continue
stage.save()
stage.commit()
stages.append(stage)
self.check_dag(self.stages() + stages)
+5
View File
@@ -526,6 +526,10 @@ class Stage(object):
self.md5 = self._compute_md5()
def commit(self):
for out in self.outs:
out.commit()
def _check_missing_deps(self):
missing = [dep for dep in self.deps if not dep.exists]
@@ -625,6 +629,7 @@ class Stage(object):
if not dry:
self.save()
self.commit()
def check_missing_outputs(self):
paths = [