Versions
Every change is an event appended to the document's log (who, through what, which ops, the resulting file tree). Nothing is ever deleted or rewritten; the database refuses updates to history.
history(newest first; filter bybranchorpath),diff(from/to, any refs).- A version is named branch.count:
genesis.38is the 38th change on genesis. A document's first branch isgenesis(documents made before:main). A branch's start is not a version of its own: eden, started at genesis.33, has eden.1 as its first change. Names never change. restorea branch to any version or snapshot: a new version, so it can be undone too.- Every change tool takes
at(the version you are looking at). At a branch's latest version the change goes there; at an older one a new branch with a generated name (eden, babel, ararat, ...) is made from it and the change goes there (the result saysbranchandbranched-from). History is never rewritten. branch(from any version) to work without touching the first branch; every change tool takesbranch, andbase(the version you read) to fail rather than overwrite a newer one.archive_branchcloses a branch you are done with (after merging it, say): an event of its own, so its history stays and its versions can still be read, restored or forked. The first branch can't be archived.mergea branch into another: three-way, per file, and per key inside EDN maps (two people changing different copy keys in one file merge cleanly). Conflicts are listed;strategyours/theirssettles them.snapshotnames a version ("sent-to-client"); refs accept snapshot names everywhere.forkmakes a new document from any version of this one (e.g. "the A4 edition"); its history keeps a link to where it came from.verify_historyreplays the log and checks every version.export_docis one zip: files, every raw asset, the full history and snapshots.import_docreads it back, here or on another server.
Refs: a branch name (its latest: genesis), a version name (genesis.38), the document-wide number
of an event (v120 or 120, as in exports), or a snapshot name. Results give version (the name) and
v (the number).