mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-12-02 15:28:29 +01:00
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:
+4
-5
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user