Sync helpers¶
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 translates validated checkout configuration into
typed libvcs backend instances, target selectors, sync policies, and structured
recovery payloads.
Shared checkout settings and sync outcomes for CLI commands.
-
class vcspull._internal.sync.SyncExecution¶class vcspull._internal.sync.SyncExecution¶
Bases:
objectKeep the backend instance and its complete synchronization result.
-
vcspull._internal.sync.create_sync_project(repo, *, vcs, progress_callback=None)¶vcspull._internal.sync.create_sync_project(repo, *, vcs, progress_callback=None)¶
Construct a typed backend without accessing or changing its checkout.
-
vcspull._internal.sync.checkout_settings(config, *, worktree=False)¶vcspull._internal.sync.checkout_settings(config, *, worktree=False)¶
Translate a validated checkout without collapsing its selector kind.
>>> target, policy = checkout_settings({"tag": "v1", "sync": {"drift": "keep"}}) >>> target.tag, policy.drift ('v1', 'keep') >>> checkout_settings(None) (None, SyncPolicy(drift='follow', dirty='abort'))
-
vcspull._internal.sync.sync_result_data(result)¶vcspull._internal.sync.sync_result_data(result)¶
Serialize recovery identity and outcomes without exception objects.
>>> sync_result_data(SyncResult())["preservation_state"] 'not-needed'
-
vcspull._internal.sync.format_recovery_lines(primary, retained=())¶vcspull._internal.sync.format_recovery_lines(primary, retained=())¶
Render deduplicated recovery, conflict, and inspection lines.
>>> token = RecoveryToken("tok-1", "git", "/tmp/store/tok-1") >>> res = SyncResult( ... recovery=token, ... update_state="completed", ... preservation_state="restored", ... ) >>> format_recovery_lines(res) ['Update: completed; local changes: restored', 'Recovery retained (git): tok-1 ...']