Repository navigation
sync,status(feat): Apply target and dirty policy - #590
Merged
Merged
Conversation
tony
force-pushed
the
feat/config-v2-targets-and-git
branch
from
November 28, 2026 17:46
b43cfbe to
66164c6
Compare
tony
force-pushed
the
feat/status-and-sync-policy
branch
from
November 28, 2026 17:46
a282228 to
0e370bc
Compare
This was referenced Nov 28, 2026
tony
force-pushed
the
feat/config-v2-targets-and-git
branch
from
November 28, 2026 17:52
66164c6 to
dd39d38
Compare
tony
force-pushed
the
feat/status-and-sync-policy
branch
from
November 28, 2026 17:52
0e370bc to
ad65bf4
Compare
This was referenced Nov 28, 2026
tony
force-pushed
the
feat/config-v2-targets-and-git
branch
from
November 28, 2026 20:54
dd39d38 to
ec77c71
Compare
tony
force-pushed
the
feat/status-and-sync-policy
branch
from
November 28, 2026 20:54
ad65bf4 to
9f6c18e
Compare
tony
force-pushed
the
feat/status-and-sync-policy
branch
from
November 28, 2026 21:58
9f6c18e to
2da8586
Compare
tony
force-pushed
the
feat/config-v2-targets-and-git
branch
from
November 28, 2026 21:58
ec77c71 to
224e504
Compare
tony
force-pushed
the
feat/status-and-sync-policy
branch
from
November 28, 2026 22:27
2da8586 to
16a4b94
Compare
tony
force-pushed
the
feat/config-v2-targets-and-git
branch
2 times, most recently
from
November 28, 2026 22:31
20cd43a to
efbb876
Compare
tony
force-pushed
the
feat/status-and-sync-policy
branch
from
November 28, 2026 22:31
16a4b94 to
8661a7c
Compare
why: Configured targets and dirty policies must reach the native backend, and retained recovery details must survive CLI reporting. what: - Forward immutable target and policy values without changing input - Require --yes before any configured discard accesses a repository - Preserve recovery tokens, states, conflicts, and ordered failures - Keep target-drift warnings visible in interactive output - Verify native target selection, dirty policy, and machine output
why: Status and previews need the same target and policy contract as sync, including unknown state when native metadata cannot resolve it. what: Read Git, Hg, and SVN positions without fetching. Report resolved drift and errors, preserve policy in previews, and distinguish Git attachment work from revision drift. Share typed backend construction.
why: Timed-out threads keep mutating repositories and redirecting parent output, while late recovery tokens can disappear. what: Run sync in an owned process group with independent streamed output and result channels. Stop native descendants before returning, inspect retained recovery records after interruption, and preserve complete results in human and machine output. Verify native Git interruption, source-independent SVN discovery, pipe-sized split UTF-8 frames, abnormal exits, and sequential timeout cleanup. Full suite: 1671 passed, 1 skipped; 27 snapshots passed.
why: Loaded remotes use GitRemote objects that the Mercurial backend cannot consume, and wire mappings must omit their key name. what: Convert native path settings at the backend boundary and serialize Git and Mercurial fetch/push URLs separately. Verify selected-source updates through direct calls and owned workers.
tony
force-pushed
the
feat/status-and-sync-policy
branch
from
November 28, 2026 22:32
8661a7c to
5b0b69b
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #590 +/- ##
==========================================
- Coverage 84.40% 83.76% -0.65%
==========================================
Files 33 35 +2
Lines 5221 5587 +366
Branches 1049 1117 +68
==========================================
+ Hits 4407 4680 +273
- Misses 539 615 +76
- Partials 275 292 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--yesconfirmation beforedirty: discardtouches a repository.SyncExecutionfromvcspull.cli.sync.update_repo().vcspull status.PYTHONPATH.Before / After
Python API (
vcspull.cli.sync.update_repo) — Before:Python API (
vcspull.cli.sync.update_repo) — After:Dirty working tree with
dirty: discard— without--yesvs with--yes:Changes by area
Sync policy, recovery, and programmatic API
src/vcspull/_internal/sync.py: addSyncExecution,create_sync_project(),checkout_settings(),sync_result_data(),format_recovery_lines(), andrequire_discard_authorization(); convertGitRemotemappings for Mercurial without mutating push URLs.src/vcspull/cli/sync.pyandsrc/vcspull/cli/__init__.py: add--yestovcspull sync; returnSyncExecutionfromupdate_repo()(re-exported invcspull.cli.sync) and attachSyncResulttoSyncFailedError; emitupdate_state,preservation_state,recovery,conflicts,errors, andretained_recoveriesin human, JSON, and NDJSON output; plan target drift and dirty policies in--dry-run.Owned worker supervision
src/vcspull/_internal/sync_process.py: run each repository mutation in astart_new_session=Truechild process over a non-inheritable JSON control pipe with incremental UTF-8 stdout/stderr decoding andsys.argvpackage bootstrap (keeping childPYTHONPATHuntouched); sendSIGTERMthenSIGKILLto the process group on timeout orSIGINT, then run a 1-second boundedinspectworker to report retained recovery tokens.Offline
statustarget resolution and documentationsrc/vcspull/cli/status.py: inspect nativeposition,target_position,policy,drifted, anderrorsacross Git, Mercurial, and Subversion without fetching; passprotocol.allow=neverandGIT_NO_LAZY_FETCH=1on supplemental Gitrev-listreads so partial clones never lazy-fetch objects duringstatus.docs/cli/status.md,docs/cli/sync.md,docs/internals/api/sync.md,docs/internals/api/sync_process.md,CHANGES,MIGRATION: document JSON schemas,SyncExecution, worker supervision, and breaking defaults.Design decisions
start_new_session=True+os.killpg) instead of a daemon thread so timeouts andSIGINTstop native VCS descendants before the next repository runs.vcspullimport root throughsys.argvrather thanos.environ["PYTHONPATH"]so native VCS binaries (such as Python-based/usr/bin/hg) andshell_command_afterhooks never inherit vcspull'ssite-packages.list_recoveries()) in a separate 1-second worker after timeout orSIGINTso an interrupteddirty: preserverun surfaces its recovery token without risking a second hang.--yeson everyvcspull syncinvocation (andyes=Trueinupdate_repo()) even whendirty: discardis configured in YAML.Companion PR
libvcs0.47.0)Stack
fix/ci-smoke-and-config-fixesfeat/config-v2-targets-and-gitfeat/status-and-sync-policy(this PR)options-streamline-and-git-filteringTest plan
dirty: abort/preserve/discard(--yesguard),SyncExecution/SyncFailedError.result, and Mercurial separate fetch/push URLs:$ uv run py.test tests/test_sync.py tests/test_cli.py tests/test_log.pyvcspull statustarget drift across Git, Mercurial, and Subversion (mixed/switched working copies, VCS mismatch errors, andGIT_NO_LAZY_FETCH=1):$ uv run py.test tests/cli/test_status.pySIGTERM-resistant descendant cleanup on timeout, clean childPYTHONPATH, split UTF-8 pipe framing, and post-timeout recovery inspection:$ uv run py.test tests/cli/test_sync_watchdog.pyWIFSIGNALED(SIGINT)process-group termination and retained recovery reporting on Ctrl-C:$ uv run py.test tests/cli/test_sync_sigint.pyRefs #123, #124, #393, #577, #587.