entryChanges
What a history entry changed (from the entry before it on its branch).
import { namesChanged, stateAt } from "#codebase/tcmts/cli/changes"; import type { NameChange, NamesFrom } from "#codebase/tcmts/cli/changes"; import type { Codebase } from "#codebase/tcmts/cli/codebase"; export function entryChanges( cb: Codebase, hash: string, viewUri: (hash: string, names: NamesFrom) => string, ): NameChange[] { const c = cb.store.causal(hash); if (!c?.parents.length) return []; const parent = c.parents[0]!; return namesChanged(cb, stateAt(cb, parent), stateAt(cb, hash), (h, side) => viewUri(h, { at: side === "before" ? parent : hash }), ); }
uses
- tcmts.cli.changes.NameChange
- tcmts.cli.changes.NamesFrom
- tcmts.cli.changes.namesChanged
- tcmts.cli.changes.stateAt
- tcmts.cli.codebase.Codebase