vcspull add - vcspull.cli.add

Add single repository functionality for vcspull.

vcspull.cli.add.create_add_subparser(parser)[source]

Create vcspull add argument subparser.

Return type:

None

Parameters:

parser (argparse.ArgumentParser) – The parser to configure

vcspull.cli.add._resolve_workspace_path(workspace_root, repo_path_str, *, cwd)[source]

Resolve workspace path from arguments.

Return type:

Path

Parameters:
  • workspace_root (str | None) – Workspace root path from user

  • repo_path_str (str | None) – Repo path from user

  • cwd (pathlib.Path) – Current working directory

Returns:

Resolved workspace path

Return type:

pathlib.Path

vcspull.cli.add._detect_git_remote(repo_path)[source]

Return the origin remote URL for a Git repository if available.

Return type:

str | None

Parameters:

repo_path (Path)

vcspull.cli.add._normalize_detected_url(remote)[source]

Return display and config URLs derived from a detected remote.

Return type:

tuple[str, str]

Parameters:

remote (str | None)

vcspull.cli.add._build_ordered_items(top_level_items, raw_config)[source]

Return deep-copied top-level items preserving original ordering.

Return type:

list[dict[str, Any]]

Parameters:
vcspull.cli.add._aggregate_from_ordered_items(items)[source]

Collapse ordered top-level items into a mapping grouped by label.

Return type:

dict[str, Any]

Parameters:

items (list[dict[str, Any]])

vcspull.cli.add._collect_duplicate_sections(items)[source]

Return mapping of labels to their repeated sections (>= 2 occurrences).

Return type:

dict[str, list[Any]]

Parameters:

items (list[dict[str, Any]])

vcspull.cli.add.handle_add_command(args)[source]

Entry point for the vcspull add CLI command.

Return type:

None

Parameters:

args (argparse.Namespace)

vcspull.cli.add.add_repo(name, url, config_file_path_str, path, workspace_root_path, dry_run, *, merge_duplicates=True)[source]

Add a repository to the vcspull configuration.

Return type:

None

Parameters:
  • name (str) – Repository name for the config

  • url (str) – Repository URL

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

  • path (str | None) – Local path where repo will be cloned

  • workspace_root_path (str | None) – Workspace root to use in config

  • dry_run (bool) – If True, preview changes without writing

  • merge_duplicates (bool)