vcspull sync - vcspull.cli.sync

Synchronization functionality for vcspull.

class vcspull.cli.sync.SyncPlanConfig(fetch, offline)[source]

Bases: object

Configuration options for building sync plans.

Parameters:
fetch: bool
offline: bool
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(total, colors, enabled)[source]

Bases: object

Render incremental plan progress for human-readable dry runs.

Parameters:
  • total (int)

  • colors (Colors)

  • enabled (bool)

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:

pathlib.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, Optional[str]]

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

Decide which plan action applies to a repository.

Return type:

tuple[PlanAction, Optional[str]]

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:

argparse.ArgumentParser

Parameters:

parser (argparse.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, parser=None)[source]

Entry point for vcspull sync.

Return type:

None

Parameters:
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:

VCSLiteral | None

Parameters:

url (str)

exception vcspull.cli.sync.CouldNotGuessVCSFromURL(repo_url, *args, **kwargs)[source]

Bases: VCSPullException

Raised when no VCS could be guessed from a URL.

Parameters:
Return type:

None

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

Synchronize a single repository.

Return type:

GitSync

Parameters:
  • repo_dict (t.Any)

  • progress_callback (ProgressCallback | None)