Roadmap item 11, part one: inspect opens the archive read-only and never creates one.
Before this, inspect went through init::open. Inspecting a mistyped path created an empty archive there, and inspecting an older archive upgraded its layout. Both contradict the usage docs, which said it never writes.
Now it uses init::open_read_only:
If there's no archive at the path, or the file isn't an archive, that's an error and nothing is created.
An archive that lacks part of today's schema is refused, not changed.
An archive that another run holds is reported as in use.
A closed archive (no -wal) is opened immutable. Without that, SQLite leaves -shm and -wal files even after a read-only open.
When there is a -wal, from a run that's still going or was interrupted, it's opened read-only so those writes still show.
Tests in db::init:
reading leaves every file's hash unchanged and adds no side files, and writes are refused;
a missing file, a foreign SQLite file and a plain-text file are each refused;
an older layout is refused and left as it was;
an interrupted run's rows are shown from the -wal;
a held archive reports "in use";
the URI encoding.
I also checked the built binary by hand: an archive imported from a Maildir hashes the same after inspect, and a mistyped path exits with an error and creates nothing.
Checks: fmt, clippy -D warnings, cargo test --locked (1476 passed).
The Maildir keywords part of item 11 was already done: the reader existed, and #26 fixed it to match.
Roadmap item 11, part one: `inspect` opens the archive read-only and never creates one.
Before this, `inspect` went through `init::open`. Inspecting a mistyped path created an empty archive there, and inspecting an older archive upgraded its layout. Both contradict the usage docs, which said it never writes.
Now it uses `init::open_read_only`:
- If there's no archive at the path, or the file isn't an archive, that's an error and nothing is created.
- An archive that lacks part of today's schema is refused, not changed.
- An archive that another run holds is reported as in use.
- A closed archive (no `-wal`) is opened `immutable`. Without that, SQLite leaves `-shm` and `-wal` files even after a read-only open.
- When there is a `-wal`, from a run that's still going or was interrupted, it's opened read-only so those writes still show.
Tests in `db::init`:
- reading leaves every file's hash unchanged and adds no side files, and writes are refused;
- a missing file, a foreign SQLite file and a plain-text file are each refused;
- an older layout is refused and left as it was;
- an interrupted run's rows are shown from the `-wal`;
- a held archive reports "in use";
- the URI encoding.
I also checked the built binary by hand: an archive imported from a Maildir hashes the same after `inspect`, and a mistyped path exits with an error and creates nothing.
Checks: fmt, clippy `-D warnings`, `cargo test --locked` (1476 passed).
The Maildir keywords part of item 11 was already done: the reader existed, and #26 fixed it to match.
inspect went through init::open, which creates a missing archive and
brings an older layout up to date. It now uses init::open_read_only:
a missing path or a file that isn't an archive is an error, an archive
missing part of today's schema is refused rather than changed, and an
archive another run holds is reported as in use.
A closed archive has no -wal file and is opened immutable, so reading it
leaves nothing beside it; SQLite otherwise adds -shm and -wal files even
for a read-only connection. With a -wal there, it is opened read-only so
an interrupted run's writes are shown.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Roadmap item 11, part one:
inspectopens the archive read-only and never creates one.Before this,
inspectwent throughinit::open. Inspecting a mistyped path created an empty archive there, and inspecting an older archive upgraded its layout. Both contradict the usage docs, which said it never writes.Now it uses
init::open_read_only:-wal) is openedimmutable. Without that, SQLite leaves-shmand-walfiles even after a read-only open.-wal, from a run that's still going or was interrupted, it's opened read-only so those writes still show.Tests in
db::init:-wal;I also checked the built binary by hand: an archive imported from a Maildir hashes the same after
inspect, and a mistyped path exits with an error and creates nothing.Checks: fmt, clippy
-D warnings,cargo test --locked(1476 passed).The Maildir keywords part of item 11 was already done: the reader existed, and #26 fixed it to match.