Merge pull request #1414 from efiop/master

dvc: catch cached stages
This commit is contained in:
Ruslan Kuprieiev
2018-12-05 06:03:44 +02:00
committed by GitHub
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -248,6 +248,10 @@ class Project(object):
outs=[f],
add=True)
if stage is None:
stages.append(stage)
continue
self._check_output_duplication(stage.outs, all_stages)
stage.save()
@@ -414,6 +418,9 @@ class Project(object):
deps=[url],
outs=[out])
if stage is None:
return None
self._check_output_duplication(stage.outs, self.stages())
self._check_circular_dependency(stage.deps, stage.outs)
+4
View File
@@ -1,5 +1,6 @@
import os
import stat
import time
import shutil
import filecmp
@@ -113,6 +114,9 @@ class TestAddModifiedDir(TestDvc):
self.assertEqual(len(stages), 1)
self.assertTrue(stages[0] is not None)
os.unlink(self.DATA)
time.sleep(2)
stages = self.dvc.add(self.DATA_DIR)
self.assertEqual(len(stages), 1)
self.assertTrue(stages[0] is not None)