mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-29 23:09:23 +01:00
dvc: introduce protected mode
This is an opt-in mode, that will make data in the workspace read-only, thus protecting cache from corruption when hardlinks or symlinks are used. User can use `dvc unprotect file` command, to replace read-only link to cache with an editable copy. We can use this for now to decide if we want to go with a `unified workflow` in the future or if we want to set unprotected `reflink,copy` by default. Fixes #799 Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+14
@@ -8,6 +8,7 @@ from dvc.command.init import CmdInit
|
||||
from dvc.command.destroy import CmdDestroy
|
||||
from dvc.command.remove import CmdRemove
|
||||
from dvc.command.move import CmdMove
|
||||
from dvc.command.unprotect import CmdUnprotect
|
||||
from dvc.command.run import CmdRun
|
||||
from dvc.command.repro import CmdRepro
|
||||
from dvc.command.data_sync import CmdDataPush, CmdDataPull, CmdDataFetch
|
||||
@@ -521,6 +522,19 @@ def parse_args(argv=None):
|
||||
help='Destination.')
|
||||
move_parser.set_defaults(func=CmdMove)
|
||||
|
||||
# Unprotect
|
||||
UNPROTECT_HELP = 'Unprotect data file/directory.'
|
||||
unprotect_parser = subparsers.add_parser(
|
||||
'unprotect',
|
||||
parents=[parent_parser],
|
||||
description=UNPROTECT_HELP,
|
||||
help=UNPROTECT_HELP)
|
||||
unprotect_parser.add_argument(
|
||||
'targets',
|
||||
nargs='+',
|
||||
help='Data files/directory.')
|
||||
unprotect_parser.set_defaults(func=CmdUnprotect)
|
||||
|
||||
# Garbage collector
|
||||
GC_HELP = 'Collect garbage.'
|
||||
gc_parser = subparsers.add_parser(
|
||||
|
||||
Reference in New Issue
Block a user