Artifact 5e46525cc5c70f6c80fc400d54dc157124c1de7820d6055b4a63d2eec42b6ad7:
- File
internal/checkout/update.go
-
2026-10-19 16:10:06
— part of check-in
[294a537880]
on branch feat/submanifest-reader
— fix(checkout): save undo state in Update, as fossil does
Update saved no undo state, so nothing could reverse it. It now reads the file of every step that writes or removes one before writing, as fossil's update calls undo_save, and saves those files with copies of vfile and vmerge and the checked-out version in the same transaction that moves the checkout to the target. If a write fails partway the files are put back, as fossil's undo_rollback does.
Checkout.Undo and Checkout.Redo (internal and public) swap that state back and forth and keep checkout-hash naming the restored version. The undo package gains ReadFile, SaveTx and RestoreFiles, and its undo table now has fossil's schema (isExe, unique pathname, rowid order, the executable bit read from disk), so fossil undo reverses a go-libfossil update and Checkout.Undo reverses fossil update; fossil 2.28 interop tests check both. Under js/wasm, which has no undo package, Update saves nothing.
Tracked in #446 (user: [email protected], size: 26829) [annotate] [blame] [check-ins using]
- 2026-10-19 16:25:29 — part of check-in [da7c8a19cd] on branch feat/submanifest-reader — Merge branch 'fix/update-undo' into feat/submanifest-reader (user: [email protected], size: 26829) [annotate] [blame] [check-ins using]
-
2026-10-19 16:29:46
— part of check-in
[d6ac19e580]
on branch feat/submanifest-reader
— Merge branch 'feat/submanifest-reader' into fix/stash-undo-followups
# Conflicts: # internal/undo/undo.go (user: [email protected], size: 26829) [annotate] [blame] [check-ins using]
-
2026-10-19 16:10:06
— part of check-in
[294a537880]
on branch feat/submanifest-reader
— fix(checkout): save undo state in Update, as fossil does