vcspull sync - vcspull.cli.sync¶

Synchronization functionality for vcspull.

class vcspull.cli.sync.SyncPlanConfig[source]¶

Bases: object

Configuration options for building sync plans.

fetch: bool¶
offline: bool¶
__init__(fetch, offline)[source]¶
Parameters:
Return type:

None

vcspull.cli.sync._visible_length(text)[source]¶

Return the printable length of string stripped of ANSI codes.

Return type:

int

Parameters:

text (str)

class vcspull.cli.sync.PlanProgressPrinter[source]¶

Bases: object

Render incremental plan progress for human-readable dry runs.

__init__(total, colors, enabled)[source]¶
Parameters:
  • total (int)

  • colors (Colors)

  • enabled (bool)

Return type:

None

update(summary, processed)[source]¶

Update the progress line with the latest summary counts.

Return type:

None

Parameters:
  • summary (PlanSummary)

  • processed (int)

finish()[source]¶

Ensure the progress line is terminated with a newline.

Return type:

None

vcspull.cli.sync._extract_repo_url(repo)[source]¶

Extract the primary repository URL from a config dictionary.

Return type:

str | None

Parameters:

repo (ConfigDict)

vcspull.cli.sync._get_repo_path(repo)[source]¶

Return the resolved filesystem path for a repository entry.

Return type:

Path

Parameters:

repo (ConfigDict)

vcspull.cli.sync.clamp(n, _min, _max)[source]¶

Clamp a number between a min and max value.

Return type:

int

Parameters:
vcspull.cli.sync._maybe_fetch(repo_path, *, config)[source]¶

Optionally fetch remote refs to provide accurate status.

Return type:

tuple[bool, str | None]

Parameters:
vcspull.cli.sync._determine_plan_action(status, *, config)[source]¶

Decide which plan action applies to a repository.

Return type:

tuple[PlanAction, str | None]

Parameters:
vcspull.cli.sync._update_summary(summary, action)[source]¶

Update summary counters for the given plan action.

Return type:

None

Parameters:
  • summary (PlanSummary)

  • action (PlanAction)

vcspull.cli.sync._build_plan_entry(repo, *, config)[source]¶

Construct a plan entry for a repository configuration.

Return type:

PlanEntry

Parameters:
async vcspull.cli.sync._build_plan_result_async(repos, *, config, progress)[source]¶

Build a plan asynchronously while updating progress output.

Return type:

PlanResult

Parameters:
vcspull.cli.sync._filter_entries_for_display(entries, *, show_unchanged)[source]¶

Filter entries based on whether unchanged repos should be rendered.

Return type:

list[PlanEntry]

Parameters:
  • entries (list[PlanEntry])

  • show_unchanged (bool)

vcspull.cli.sync._format_detail_text(entry, *, colors, include_extras)[source]¶

Generate the detail text for a plan entry.

Return type:

str

Parameters:
  • entry (PlanEntry)

  • colors (Colors)

  • include_extras (bool)

vcspull.cli.sync._render_plan(formatter, colors, plan, render_options, *, dry_run, total_repos)[source]¶

Render the plan in human-readable format.

Return type:

None

Parameters:
  • formatter (OutputFormatter)

  • colors (Colors)

  • plan (PlanResult)

  • render_options (PlanRenderOptions)

  • dry_run (bool)

  • total_repos (int)

vcspull.cli.sync._emit_plan_output(formatter, colors, plan, render_options, *, dry_run, total_repos)[source]¶

Emit plan output for the requested format.

Return type:

None

Parameters:
  • formatter (OutputFormatter)

  • colors (Colors)

  • plan (PlanResult)

  • render_options (PlanRenderOptions)

  • dry_run (bool)

  • total_repos (int)

vcspull.cli.sync.create_sync_subparser(parser)[source]¶

Create vcspull sync argument subparser.

Return type:

ArgumentParser

Parameters:

parser (ArgumentParser)

vcspull.cli.sync.sync(repo_patterns, config, workspace_root, dry_run, output_json, output_ndjson, color, exit_on_error, show_unchanged, summary_only, long_view, relative_paths, fetch, offline, verbosity, sync_all=False, parser=None, include_worktrees=False)[source]¶

Entry point for vcspull sync.

Return type:

None

Parameters:
vcspull.cli.sync._emit_summary(formatter, colors, summary)[source]¶

Emit the structured summary event and optional human-readable text.

Return type:

None

Parameters:
  • formatter (OutputFormatter)

  • colors (Colors)

  • summary (dict[str, int])

vcspull.cli.sync.progress_cb(output, timestamp)[source]¶

CLI Progress callback for command.

Return type:

None

Parameters:
vcspull.cli.sync.guess_vcs(url)[source]¶

Guess the VCS from a URL.

Return type:

Literal['git', 'svn', 'hg'] | None

Parameters:

url (str)

exception vcspull.cli.sync.CouldNotGuessVCSFromURL[source]¶

Bases: VCSPullException

Raised when no VCS could be guessed from a URL.

__init__(repo_url, *args, **kwargs)[source]¶
Parameters:
Return type:

None

exception vcspull.cli.sync.SyncFailedError[source]¶

Bases: VCSPullException

Raised when a sync operation completes but with errors.

__init__(repo_name, errors, *args, **kwargs)[source]¶
Parameters:
Return type:

None

vcspull.cli.sync.update_repo(repo_dict, progress_callback=None)[source]¶

Synchronize a single repository.

Return type:

GitSync | HgSync | SvnSync

Parameters: