mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 15:28:28 +01:00
pull: Add --force flag that permeates down to checkout
This commit is contained in:
@@ -325,6 +325,11 @@ def parse_args(argv=None):
|
||||
default=False,
|
||||
help='Fetch cache for all dependencies of the '
|
||||
'specified target.')
|
||||
pull_parser.add_argument(
|
||||
'-f',
|
||||
'--force',
|
||||
help='Do not prompt when removing '
|
||||
'working directory files.')
|
||||
pull_parser.set_defaults(func=CmdDataPull)
|
||||
|
||||
# Push
|
||||
|
||||
@@ -25,7 +25,8 @@ class CmdDataPull(CmdDataBase):
|
||||
show_checksums=self.args.show_checksums,
|
||||
all_branches=self.args.all_branches,
|
||||
all_tags=self.args.all_tags,
|
||||
with_deps=self.args.with_deps)
|
||||
with_deps=self.args.with_deps,
|
||||
force=self.args.force)
|
||||
except Exception as exc:
|
||||
self.project.logger.error('Failed to pull data from the cloud',
|
||||
exc)
|
||||
|
||||
+3
-2
@@ -762,7 +762,8 @@ class Project(object):
|
||||
all_branches=False,
|
||||
show_checksums=False,
|
||||
with_deps=False,
|
||||
all_tags=False):
|
||||
all_tags=False,
|
||||
force=False):
|
||||
self.fetch(target,
|
||||
jobs,
|
||||
remote=remote,
|
||||
@@ -770,7 +771,7 @@ class Project(object):
|
||||
all_tags=all_tags,
|
||||
show_checksums=show_checksums,
|
||||
with_deps=with_deps)
|
||||
self.checkout(target=target, with_deps=with_deps)
|
||||
self.checkout(target=target, with_deps=with_deps, force=force)
|
||||
|
||||
def _local_status(self, target=None):
|
||||
status = {}
|
||||
|
||||
Reference in New Issue
Block a user