fix(sync): set remote location when syncing to explicit revision#137
Open
diredex wants to merge 1 commit into
Open
fix(sync): set remote location when syncing to explicit revision#137diredex wants to merge 1 commit into
diredex wants to merge 1 commit into
Conversation
Signed-off-by: Dex <[email protected]>
diredex
force-pushed
the
fix-sync-explicit-remote-branch-pointer
branch
from
July 20, 2026 22:29
9659ae3 to
d430dd9
Compare
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.
Fix: Update branch
Latestpointer on explicit--remotesyncSummary
Fixes a bug where syncing explicitly to a specific remote revision (
lore sync <revision> --remote) would correctly update the local working copy but fail to advance the local branch'sLatestpointer metadata.As a result of the stale pointer,
lore statuswould falsely reportLocal branch is behind remote, and subsequentlore syncoperations would fail to realize they were already fully synced.Root Cause
When
lore syncresolves a target implicitly (without a user-provided hash), it compares local vs. remote latest pointers and appropriately sets the internallocationflag to eitherLocalorRemote. The localLatestmetadata pointer is only updated at the end of the sync iflocation == Remote.However, when a user explicitly provides a revision hash, this divergence resolution logic was completely bypassed. The target revision was resolved blindly, and
locationwas never updated from its default value (Local). Consequently, the branch pointer update block was skipped entirely at the end of the sync process.Changes
lore-revision/src/revision/sync.rs: Added logic in the explicit revision path to search the remote timeline (history::find_branch_point) when--remoteis active. If the explicit revision exists on the remote, thelocationis properly set toRemote, allowing the pointer update block to execute normally.scripts/test/test_sync.py: Added an automated end-to-end Python integration test (test_sync_remote_explicit_revision) that reproduces the bug structure and asserts thatstatusandsyncbehave correctly post-sync.Verification
test_sync.pysuite.lore-revisionunit tests and standardclippy/fmttasks pass cleanly.