def cas.pick
import cswap-bend-cli@0.1.0.0/usage/gate.bend as Gateimport Base
import cswap-bend-cli@0.1.0.0/fs.bend as Fs
import cswap-bend-cli@0.1.0.0/json.bend as Json
86# CAS on the lineage: write the successor only when the store still holds the
87# generation we consumed; a moved store keeps its newer lineage.
88def cas.pick(+same: Bool, +path: String, +text: String, +new: String, +acct: Json.Json, +now_cred: String) -> IO(Fs.Res(Gated)):
89 match same:
90 case True{}:
91 write.back(path, text, new, acct)
92 case False{}:
93 done.g(gated.ok(now_cred, Some{now_cred}))