vcspull migrate - vcspull.cli.migrate

Migrate vcspull configuration files to the options: form.

vcspull.cli.migrate.create_migrate_subparser(parser)
function[source]
function[source]
vcspull.cli.migrate.create_migrate_subparser(parser)

Create vcspull migrate argument subparser.

Parameters:

parser (ArgumentParser)

Return type:

None

vcspull.cli.migrate.migrate_config(config_data)
function[source]
function[source]
vcspull.cli.migrate.migrate_config(config_data)

Relocate legacy top-level sync keys under options: for every entry.

Parameters:

config_data (dict) – Raw configuration data (workspace root → repo name → entry).

Returns:

The migrated configuration and the number of entries rewritten.

Return type:

tuple[dict, int]

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)
function[source]
function[source]
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:

True if the file was processed successfully, False otherwise.

Return type:

bool

vcspull.cli.migrate.migrate_config_file(config_file_path_str, write, migrate_all=False)
function[source]
function[source]
vcspull.cli.migrate.migrate_config_file(config_file_path_str, write, migrate_all=False)

Migrate vcspull configuration file(s) to the options: form.

Parameters:
  • config_file_path_str (str | None) – Path to config file, or None to use the default.

  • write (bool) – Whether to write changes back to file.

  • migrate_all (bool) – If True, migrate all discovered config files.

Return type:

None