From 7fb8a9a4274250a51a606765cf57d43b5d579086 Mon Sep 17 00:00:00 2001 From: David de la Iglesia Castro Date: Thu, 7 Sep 2023 11:55:50 +0200 Subject: [PATCH] checkout: Expose `--allow-missing` arg. (#9919) --- dvc/commands/checkout.py | 7 +++++++ tests/unit/command/test_checkout.py | 1 + 2 files changed, 8 insertions(+) diff --git a/dvc/commands/checkout.py b/dvc/commands/checkout.py index 228b2d508..a7a1b276d 100644 --- a/dvc/commands/checkout.py +++ b/dvc/commands/checkout.py @@ -37,6 +37,7 @@ class CmdCheckout(CmdBase): force=self.args.force, relink=self.args.relink, recursive=self.args.recursive, + allow_missing=self.args.allow_missing, ) except CheckoutError as _exc: exc = _exc @@ -101,6 +102,12 @@ def add_parser(subparsers, parent_parser): default=False, help="Recreate links or copies from cache to workspace.", ) + checkout_parser.add_argument( + "--allow-missing", + action="store_true", + default=False, + help="Ignore errors if some of the files or directories are missing.", + ) checkout_parser.add_argument( "targets", nargs="*", diff --git a/tests/unit/command/test_checkout.py b/tests/unit/command/test_checkout.py index 79f988da0..61723942b 100644 --- a/tests/unit/command/test_checkout.py +++ b/tests/unit/command/test_checkout.py @@ -16,6 +16,7 @@ def test_checkout(tmp_dir, dvc, mocker): recursive=False, relink=True, with_deps=True, + allow_missing=False, )