cambria

Fossil Version Control: Schema ↔ Core Linkage
Login

This document explains how Fossil’s repository schema underpins the version control core, with emphasis on document/version artifacts and their relationships. It maps key tables and indexes in schema.sql to the responsibilities in (source paths under src/):

Core Data Model

Module Linkage

checkin.c (Commit Operations)

Cross-refs: src/checkin.c, src/manifest.c, src/tag.c, src/event.c.

checkout.c (Checkout/Update Operations)

Cross-refs: src/checkout.c, src/vfile.c, src/content.c.

merge.c (Three-Way Merge Logic)

Cross-refs: src/merge.c, src/diff.c, src/plink.c (logical graph via plink), src/filename.c (path intern).

delta.c (Delta Compression Algorithm)

Cross-refs: src/delta.c, src/blob.c, src/content.c.

manifest.c (Manifest Parsing and Generation)

Cross-refs: src/manifest.c, src/mlink.c (derived linkage), src/tag.c.

rebuild.c (Repository Rebuild Operations)

Cross-refs: src/rebuild.c, src/tag.c, src/event.c, src/leaf.c.

sync.c (Push/Pull/Sync Operations)

Cross-refs: src/sync.c, src/xfer.c, src/shun.c, src/clone.c.

xfer.c (Network Transfer Protocol)

Cross-refs: src/xfer.c, src/sync.c, src/http_*.c.

Document Versioning Flow

Step 1: Authoring and Check-in

Step 2: Branching and Tags

Step 3: Checkout and Update

Step 4: Merge

Step 5: Sync

Step 6: Rebuild

Indexes and Performance

Special States and Maintenance

Traceability Map (Quick Reference)

Where function-level detail is needed, see module-specific comments and COMMAND:/WEBPAGE: indices generated by tools/mkindex.c.

Summary

Fossil’s VC core treats blob artifacts and manifest semantics as the single source of truth. Derived tables such as mlink, plink, leaf, and tagxref provide efficient views optimized for commit, checkout, merge, and sync operations. The schema’s indexes and maintenance tables ensure performance and robustness across local edits, merges, and distributed synchronization.