Skip to content
go-libfossil Check-in [d367012009]
Login

Check-in [d367012009]

Overview
Comment:feat: read an artifact by hash and cache content on Repo

Repo.ReadBlob expands one artifact by its full hash after the availability check ReadFile applies, and names an unknown hash with ErrArtifactNotFound.

Repo.SetContentCache attaches a byte-bounded content.Cache that ReadFile, ReadFileAt, ReadBlob, ListFiles, Diff and Annotate share; check-in parses are kept in its derived memo, so reads at one check-in parse the manifest once. Default off. A read that finds the DB's finished-write count moved swaps in an empty cache, so a purged, compacted or elided artifact, and a rid SQLite reuses after a purge, is never served from it. Writes by another process are not seen; the method's doc says so.

Tracked in #492.

Timelines: family | ancestors | descendants | both | trunk | feat/read-blob-content-cache
Files: files | file ages | folders
SHA3-256: d3670120090bf36c45b5989973a06c101a71a3fe04789340b8dbd3726f3de650
User & Date: [email protected] on 2026-10-25 23:10:47.000
Other Links: branch diff | manifest | tags
Context
2026-10-25
23:28
Merge pull request #496 from danmestas/feat/read-blob-content-cache

feat: read an artifact by hash and cache content on Repo check-in: 5e882bf1f1 user: [email protected] tags: main, trunk

23:10
feat: read an artifact by hash and cache content on Repo

Repo.ReadBlob expands one artifact by its full hash after the availability check ReadFile applies, and names an unknown hash with ErrArtifactNotFound.

Repo.SetContentCache attaches a byte-bounded content.Cache that ReadFile, ReadFileAt, ReadBlob, ListFiles, Diff and Annotate share; check-in parses are kept in its derived memo, so reads at one check-in parse the manifest once. Default off. A read that finds the DB's finished-write count moved swaps in an empty cache, so a purged, compacted or elided artifact, and a rid SQLite reuses after a purge, is never served from it. Writes by another process are not seen; the method's doc says so.

Tracked in #492. leaf check-in: d367012009 user: [email protected] tags: feat/read-blob-content-cache, trunk

23:10
feat(db): count finished writes

DB.Writes counts pool Exec calls that returned and WithTx transactions that ended. Counting at the end is what lets a reader holding state across calls treat an unchanged count as no write having landed in between. check-in: 51be37dc1a user: [email protected] tags: feat/read-blob-content-cache, trunk

Changes