dvc: load state when taking repo lock in @locked

We are always loading state when taking a repo lock, so doing it right
in @locked decorator simplifies the code for Repo methods.
This commit is contained in:
Ruslan Kuprieiev
2019-10-10 01:08:28 +03:00
parent f254004fae
commit cba8ac7a8f
15 changed files with 172 additions and 183 deletions
+4 -5
View File
@@ -4,8 +4,7 @@ from . import locked
@locked
def commit(self, target, with_deps=False, recursive=False, force=False):
stages = self.collect(target, with_deps=with_deps, recursive=recursive)
with self.state:
for stage in stages:
stage.check_can_commit(force=force)
stage.commit()
stage.dump()
for stage in stages:
stage.check_can_commit(force=force)
stage.commit()
stage.dump()