-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rwlock: check that .dvc/lock is locked
Mostly a sanity check, but we did have a potential bug in `destroy`, whcih this PR fixes along the way. Kudos @shcheklein for catching this one.
- Loading branch information
Showing
7 changed files
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
from dvc.utils.fs import remove | ||
from . import locked | ||
|
||
|
||
def destroy(self): | ||
for stage in self.stages: | ||
@locked | ||
def _destroy_stages(repo): | ||
for stage in repo.stages: | ||
stage.remove(remove_outs=False) | ||
|
||
remove(self.dvc_dir) | ||
|
||
# NOTE: not locking `destroy`, as `remove` will need to delete `.dvc` dir, | ||
# which will cause issues on Windows, as `.dvc/lock` will be busy. | ||
def destroy(repo): | ||
_destroy_stages(repo) | ||
remove(repo.dvc_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters