(subparsers, parent_parser)
| 29 | |
| 30 | |
| 31 | def add_parser(subparsers, parent_parser): |
| 32 | COMMIT_HELP = ( |
| 33 | "Record changes to files or directories tracked by DVC" |
| 34 | " by storing the current versions in the cache." |
| 35 | ) |
| 36 | |
| 37 | commit_parser = subparsers.add_parser( |
| 38 | "commit", |
| 39 | parents=[parent_parser], |
| 40 | description=append_doc_link(COMMIT_HELP, "commit"), |
| 41 | help=COMMIT_HELP, |
| 42 | formatter_class=formatter.RawDescriptionHelpFormatter, |
| 43 | ) |
| 44 | commit_parser.add_argument( |
| 45 | "-f", |
| 46 | "--force", |
| 47 | action="store_true", |
| 48 | default=False, |
| 49 | help=( |
| 50 | "Commit data even if hash values for dependencies or " |
| 51 | "outputs did not change." |
| 52 | ), |
| 53 | ) |
| 54 | commit_parser.add_argument( |
| 55 | "-d", |
| 56 | "--with-deps", |
| 57 | action="store_true", |
| 58 | default=False, |
| 59 | help="Commit all dependencies of the specified target.", |
| 60 | ) |
| 61 | commit_parser.add_argument( |
| 62 | "-R", |
| 63 | "--recursive", |
| 64 | action="store_true", |
| 65 | default=False, |
| 66 | help="Commit cache for subdirectories of the specified directory.", |
| 67 | ) |
| 68 | commit_parser.add_argument( |
| 69 | "--no-relink", |
| 70 | dest="relink", |
| 71 | action="store_false", |
| 72 | help="Don't recreate links from cache to workspace.", |
| 73 | ) |
| 74 | commit_parser.set_defaults(relink=True) |
| 75 | commit_parser.add_argument( |
| 76 | "targets", |
| 77 | nargs="*", |
| 78 | help=( |
| 79 | "Limit command scope to these tracked files/directories, " |
| 80 | ".dvc files and stage names." |
| 81 | ), |
| 82 | ).complete = completion.DVCFILES_AND_STAGE |
| 83 | commit_parser.set_defaults(func=CmdCommit) |
nothing calls this directly
no test coverage detected