def at.effect

ezx@1.11.0.0 · src/ws/relock.bend:72

import ezx@1.11.0.0/src/ws/relock.bend as Relock
import Base
import ezx@1.11.0.0/src/lock/plan.bend as LP
import ezx@1.11.0.0/src/pkg/path.bend as P

72# an effect of the root's lock as it is run from where the command runs:
73# every path it writes taken from the root. Removing a committed tree is
74# laying it with no file, which removes what was there and writes nothing.
75def at.effect(+at: String, effect: LP.Effect) -> LP.Effect:
76  match effect:
77    case LP.Write{path, text}:
78      LP.Write{P.join(at, path), text}
79    case LP.Lay{place, hash, files}:
80      LP.Lay{at.place(at, place), hash, files}
81    case LP.Drop{hash}:
82      LP.Lay{LP.Under{at}, hash, []}
83    case LP.Say{text}:
84      LP.Say{text}
85    case LP.Name{nv, hash}:
86      LP.Name{nv, hash}

Uses (6)

Used by (1)