Sync process supervision¶
Warning
Be careful with these! Internal APIs are not covered by version policies. They can break or be removed between minor versions!
If you need an internal API stabilized please file an issue.
vcspull._internal.sync_process supervises per-repository CLI mutations in
owned POSIX process groups and inspects retained recovery records after timeouts
or interrupts.
Own CLI sync workers, native descendants, and streamed output.
-
class vcspull._internal.sync_process.SyncOutcome¶class vcspull._internal.sync_process.SyncOutcome¶
Bases:
objectKeep completed results separate from forced termination and inspection.
-
exception vcspull._internal.sync_process.SyncInterrupted¶exception vcspull._internal.sync_process.SyncInterrupted¶
Bases:
KeyboardInterruptCarry retained recovery information through CLI interrupt cleanup.
-
class vcspull._internal.sync_process._Exchange¶class vcspull._internal.sync_process._Exchange¶
Bases:
object_Exchange(terminal: ‘dict[str, t.Any] | None’, output: ‘str’, timed_out: ‘bool’, returncode: ‘int | None’, interrupted: ‘bool’, protocol_error: ‘str | None’)
-
vcspull._internal.sync_process._result_from_data(data)¶vcspull._internal.sync_process._result_from_data(data)¶
-
vcspull._internal.sync_process._result_data(result)¶vcspull._internal.sync_process._result_data(result)¶
-
vcspull._internal.sync_process._worker_command(control_fd)¶vcspull._internal.sync_process._worker_command(control_fd)¶
-
vcspull._internal.sync_process._json_default(value)¶vcspull._internal.sync_process._json_default(value)¶
-
vcspull._internal.sync_process._stop_process(process)¶vcspull._internal.sync_process._stop_process(process)¶
Stop the owned session before reaping its leader or returning to the batch.
-
vcspull._internal.sync_process._exchange(request, *, timeout, progress_callback, is_human, cancel_event=None)¶vcspull._internal.sync_process._exchange(request, *, timeout, progress_callback, is_human, cancel_event=None)¶
-
vcspull._internal.sync_process.run_sync_process(repo, *, progress_callback, timeout, is_human, yes=False, worktree=None, cancel_event=None)¶vcspull._internal.sync_process.run_sync_process(repo, *, progress_callback, timeout, is_human, yes=False, worktree=None, cancel_event=None)¶
Run one owned mutation process; inspect retained records after a timeout.
- Parameters:
repo (
ConfigDict|Mapping) – Normalized repository entry to synchronize.progress_callback (
collections.abc.Callable[[str,datetime.datetime],None]) – Callback receiving streamed subprocess output chunks.timeout (
float) – Wall-clock deadline in seconds for this process group.is_human (
bool) – Whether human-facing log and progress routing is active.yes (
bool) – Whether configureddirty: discardpolicies are authorized.worktree (
WorktreeConfigDict|Mapping|None) – Optional single linked worktree entry when running a worktree sync.cancel_event (
threading.Event|None) – Optional cooperative cancellation flag polled every 50 ms onSIGINT.
- Returns:
Structured status, result, duration, and retained recovery records.
- Return type:
- Raises:
SyncInterrupted– Raised when the worker is interrupted bySIGINTorcancel_event.RuntimeError– Raised on non-POSIX platforms or wedged descendant pipes.