Repository navigation
feat(locallibrary): open a snapshot as a read-only folder with store browse - #468
Open
botandbang wants to merge 4 commits into
Open
botandbang wants to merge 4 commits into
botandbang wants to merge 4 commits into
Conversation
…browse store browse lays a snapshot out as its drive tree in a folder of links into the store, with nothing copied, and removes it when the command stops. store views lists what's open and store unbrowse removes what a crash or --keep left. Files in the store are now read-only: a write through a link would leave a file under a hash that isn't its content. Older files change when a view links them, so no store is walked to make one view. STORE_FORMAT stays 1.
SizeCompared with main. KiB are 1,024 bytes.
|
bnb
previously approved these changes
Nov 5, 2026
Rust coverageFrom run 669. Both are held to the thresholds in .cargo/config.toml.
|
# Conflicts: # apps/locallibrary/GLOSSARY.md
# Conflicts: # apps/locallibrary/GLOSSARY.md # crates/locallibrary/src/store.rs
This branch has not been deployed
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.
locallibrary store browse <snapshot>opens a past version of a drive as an ordinary folder, laid out as the drive was, so it can be opened, played or dragged into another app with nothing copied. The folder goes when the command stops. macOS and Linux only: on Windows the command says it isn't available, since links there take administrator rights.Added
store browse <snapshot> [--to DIR] [--keep]. It makes the view in a temporary folder, or in a new or empty folder given with--to, says where it is, and waits for Ctrl-C, SIGTERM or a closed terminal.--keepleaves it open.store views, listing open views and any broken links, andstore unbrowse [DIR], removing one or all of them.crates/locallibrary/src/view.rs. A file is a hard link when the view is on the store's volume and a symlink otherwise. An app treats a hard link by its own name and extension, while macOS follows a symlink to the hash-named stored file and opens it as text. A file the store has lost shows as a broken symlink and is named.views.jsonandviews.lockin the store, optional and never copied, recording open views so one left by a crash is still found.store browseandstore infowarn about open views.store unbrowserefuses any folder that isn't recorded.props_view.rsandprops_cli_view.rs, on real temporary folders: the tree matches the snapshot, in-place writes fail and leave the object's hash unchanged, nothing can be saved into a view, and closing removes everything the view made.GLOSSARY.md, a section indocs/store.md, and a row indocs/commands.mdand the README.Changed
Store::keep_object, whichimport_file,import_bytes,offsite::fetch_objectand peer fetches now share). Files from older versions change only when a view links them.store copyleaves a copy's files as they were, since a read-only file can block rename and delete on a network share.store unbrowsedeletes only links, read-only files and folders. A writable file someone put in a view stays and is reported.store pruneandlibrary prunewarn when they remove a snapshot a view shows, and go ahead. Hard links keep working and hold their space until the view is removed. Symlinks to files nothing else uses break.fs::copy, which carried a stored file's read-only permissions onto its copy and refused the next write to it.docs/plugins.mdsays so for plugin authors.store/tests.rs,tests/common/mod.rs(rot),store/copy.rs,props_offsite.rs,props_store.rs,peers.rs,props_peers.rs,props_cli_changes.rsanddrives/store.rs.Removed
offsite::fetch_objectandpeers::fetch.STORE_FORMATstays 1. Something that changes a file's permissions back can still write to it, and an app that follows a symlink and replaces the stored file gets through too.store verifyfinds both, anddocs/store.mdsays so.Needs the
all-oslabel: the Windows paths couldn't be built on the machine this was written on.Part of LOC-211.