fix(sync): set remote location when syncing to explicit revision - #137
fix(sync): set remote location when syncing to explicit revision#137diredex wants to merge 1 commit into
Conversation
9659ae3 to
d430dd9
Compare
|
@diredex Could you update to latest main and resolve the conflicts? Thanks! |
d430dd9 to
15df387
Compare
Thanks! I've rebased onto the latest main, resolved the merge conflicts, and pushed the updated branch. Let me know if there's anything else that needs to be addressed. |
15df387 to
15267d0
Compare
|
Seems to make some smoke tests fail - please evaluate if you think the tests are wrong and should be updated, or if something in this change needs to amended. |
15267d0 to
5d3a875
Compare
Signed-off-by: Dex <diredex.dev@gmail.com>
5d3a875 to
f4ae1b1
Compare
The smoke failures were regressions from my change the condition for setting location = Remote was too broad (it fired for the default search mode, not just --remote), which broke the Latest pointer for regular explicit-revision syncs and caused the merge check to trigger incorrectly. I've amended the PR with two fixes: Narrowed the remote location check to only apply when --remote is explicitly passed (ResolveSearchLocation::Remote) |
|
Imported as Lore CR-531. |
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.