vcspull sync - vcspull.cli.sync

Synchronization functionality for vcspull.

class vcspull.cli.sync.SyncPlanConfig

Bases: object

Configuration options for building sync plans.

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

Return the printable length of string stripped of ANSI codes.

Parameters:

text (str)

Return type:

int

class vcspull.cli.sync.PlanProgressPrinter

Bases: object

Render incremental plan progress for human-readable dry runs.

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

Extract the primary repository URL from a config dictionary.

Parameters:

repo (ConfigDict)

Return type:

str | None

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

Return the resolved filesystem path for a repository entry.

Parameters:

repo (ConfigDict)

Return type:

Path

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

Clamp a number between a min and max value.

Parameters:
Return type:

int

vcspull.cli.sync._maybe_fetch(repo_path, *, config)
function[source]

Optionally fetch remote refs to provide accurate status.

Parameters:
Return type:

tuple[bool, str | None]

vcspull.cli.sync._determine_plan_action(status, *, config)
function[source]

Decide which plan action applies to a repository.

Parameters:
Return type:

tuple[PlanAction, str | None]

vcspull.cli.sync._update_summary(summary, action)
function[source]

Update summary counters for the given plan action.

Parameters:
  • summary (PlanSummary)

  • action (PlanAction)

Return type:

None

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

Construct a plan entry for a repository configuration.

Parameters:
Return type:

PlanEntry

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

Build a plan asynchronously while updating progress output.

Parameters:
Return type:

PlanResult

vcspull.cli.sync._filter_entries_for_display(entries, *, show_unchanged)
function[source]

Filter entries based on whether unchanged repos should be rendered.

Parameters:
  • entries (list[PlanEntry])

  • show_unchanged (bool)

Return type:

list[PlanEntry]

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

Generate the detail text for a plan entry.

Parameters:
  • entry (PlanEntry)

  • colors (Colors)

  • include_extras (bool)

Return type:

str

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

Render the plan in human-readable format.

Parameters:
  • formatter (OutputFormatter)

  • colors (Colors)

  • plan (PlanResult)

  • render_options (PlanRenderOptions)

  • dry_run (bool)

  • total_repos (int)

Return type:

None

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

Emit plan output for the requested format.

Parameters:
  • formatter (OutputFormatter)

  • colors (Colors)

  • plan (PlanResult)

  • render_options (PlanRenderOptions)

  • dry_run (bool)

  • total_repos (int)

Return type:

None

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

Create vcspull sync argument subparser.

Parameters:

parser (ArgumentParser)

Return type:

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

Entry point for vcspull sync.

Parameters:
Return type:

None

vcspull.cli.sync._emit_summary(formatter, colors, summary)
function[source]

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

Parameters:
  • formatter (OutputFormatter)

  • colors (Colors)

  • summary (dict[str, int])

Return type:

None

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

CLI Progress callback for command.

Parameters:
Return type:

None

vcspull.cli.sync.guess_vcs(url)
function[source]

Guess the VCS from a URL.

Parameters:

url (str)

Return type:

VCSLiteral | None

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

Bases: VCSPullException

Raised when no VCS could be guessed from a URL.

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

Bases: VCSPullException

Raised when a sync operation completes but with errors.

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

Synchronize a single repository.

Parameters:
  • repo_dict (Any)

  • progress_callback (ProgressCallback | None)

Return type:

GitSync | HgSync | SvnSync