def made

ezx@1.11.0.0 · src/lock/plan.bend:918

import ezx@1.11.0.0/src/lock/plan.bend as Plan
import Base
import ezx@1.11.0.0/src/lock/world.bend as W
import ezx@1.11.0.0/src/lock/up.bend as Up
import ezx@1.11.0.0/src/lock/lock.bend as L

918# the plan for what was decided. A refusal has no effect at all, so a refused
919# lock, plain or upgrade, writes nothing, lays nothing and removes nothing; its
920# reason is how it ends. A lock that is made runs, in order: what a person is
921# told, the trees laid, a names file for every name the lock records (read
922# back from the lock's own text, so the files and the lock never disagree),
923# the upgrade's files (ez.toml once, `.gitignore`, the rewritten sources), the
924# committed trees removed, and the lock last. A plain lock has only the
925# trees, the names and the lock.
926def made(+nx: Up.Next, cs: List<&2, String>, js: List<&2, W.Judged>, doc: Doc) -> Plan:
927  match doc:
928    case Doc{+text}:
929      Plan{says.of(Up.next.says(nx),
930        lays(cs, Up.next.vends(nx), js, names.lay(L.names.read(text),
931          edits.of(Up.next.edits(nx),
932            edits.of(Up.edit.sources(Up.next.found(nx), Up.next.swaps(nx)),
933              drops.of(Up.next.drops(nx), [Write{lockfile(), text}])))))), Success{}}
934    case Stop{why}:
935      Plan{[], Refused{why}}

Uses (22)

Used by (1)