Expand description
Backup session management for undo safety net.
Before any --apply write, commands save the original content of each
affected file to .patchloom/backups/<timestamp>/. The patchloom undo
command restores the most recent (or a chosen) backup.
Structs§
- Backup
Session - An active backup session that collects originals before writes.
- Manifest
- The manifest for a backup session.
- Manifest
Entry - A single file entry in the backup manifest.
Enums§
- File
Action - What the apply operation did to a file.
Constants§
- BACKUP_
DIR - Directory name under the project root.
Functions§
- backup_
write_ files - Back up files, write new content atomically, and finalize the backup session. All originals are saved before any writes begin, ensuring consistency.
- list_
sessions - List available backup sessions, most recent first.
- prune_
old_ backups - Prune backup sessions older than 7 days.
- remove_
session - Remove a consumed backup session directory so subsequent
undocalls reach older sessions instead of replaying the same one. - restore_
session - Restore a specific backup session, returning the number of files restored.