vcspull migrate - vcspull.cli.migrate¶
Migrate vcspull configuration files to the options: form.
-
vcspull.cli.migrate.create_migrate_subparser(parser)¶vcspull.cli.migrate.create_migrate_subparser(parser)¶
Create
vcspull migrateargument subparser.- Parameters:
parser (
ArgumentParser)- Return type:
-
vcspull.cli.migrate.migrate_config(config_data)¶vcspull.cli.migrate.migrate_config(config_data)¶
Relocate legacy top-level sync keys under
options:for every entry.Examples
>>> migrate_config( ... {"~/code/": {"flask": {"repo": "git+x", "shallow": True}}} ... ) ({'~/code/': {'flask': {'repo': 'git+x', 'options': {'shallow': True}}}}, 1)
An already-migrated config is returned unchanged:
>>> migrate_config( ... {"~/code/": {"flask": {"repo": "git+x", "options": {"shallow": True}}}} ... ) ({'~/code/': {'flask': {'repo': 'git+x', 'options': {'shallow': True}}}}, 0)
-
vcspull.cli.migrate.migrate_single_config(config_file_path, write)¶vcspull.cli.migrate.migrate_single_config(config_file_path, write)¶
Migrate a single vcspull configuration file.
- Parameters:
config_file_path (
pathlib.Path) – Path to config file.write (
bool) – Whether to write changes back to file.
- Returns:
Trueif the file was processed successfully,Falseotherwise.- Return type: