~/bend-docscommunity

src/ws/up.bend checks

raw source on the hub · import ezx@1.14.0.0/src/ws/up.bend as Up

ws/up: ez lock --upgrade at a workspace root (laws/WorkspaceOnePinPerSource.bend). The upgrade is planned, as the lock is, on the joint ledger (ws/joint.bend), so a source a name declares moves once for the whole workspace. What it writes back is not the joint ledger, which no file holds: the one write of ez.toml the upgrade plans is replaced by a write of every ledger that declares a moved name, the root's and each member's, each dependency and tool taking its new pin from the joint ledger the upgrade leaves while keeping the source as that ledger records it, relative to its own directory. Every other effect of the plan is kept as it was.

10 imports
import Base
import ../ledger/manifest.bend as M
import ../ledger/render.bend as Rend
import ../toml/toml.bend as T
import ../lock/world.bend as LW
import ../lock/plan.bend as LP
import ../pkg/pkg.bend as K
import ./workspace.bend as W
import ./joint.bend as J
import ./moved.bend as Mv

Types

type Back source · line 27 · raw

Data

what the write-back needs: nothing, for a project of its own, or the root's ledger text, what its [workspace] table says, every other ez.toml git lists under the root, and the text of the lock being rewritten, "" for none, which records each member's hash before it moved (laws/HashedMemberMovesCascade.bend)

type Up source · line 285 · raw

Data

the World an upgrade plans on, and the files it rewrites

Definitions

def source.back source · line 36 · raw

@own:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Source -> @joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Source -> 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Source

a source with the pin the joint ledger now gives it: the joint's commit, tag, root and narHash, and this ledger's own url and vendor bit

def dep.back.src source · line 54 · raw

@own:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Source -> @+nn:String -> @+hh:String -> @+ee:String -> @joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep -> 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep

a dependency with the pin the joint ledger gives its name, by its own source: a workspace member's section is kept as it is written, since the hash and entry the joint ledger gives it are no ledger's to record

def dep.back.at source · line 66 · raw

@own:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep -> @joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep -> 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep

a dependency with the pin the joint ledger gives its name

def dep.back source · line 71 · raw

@+own:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep -> @+js:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep> -> 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep

a dependency of a ledger, after the upgrade

def deps.back source · line 75 · raw

@ds:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep> -> @+js:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep> -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep>

every dependency of a ledger, after the upgrade

def tool.back.at source · line 83 · raw

@own:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Cli -> @joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Cli -> 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Cli

a tool with the pin the joint ledger gives its name

def tool.back source · line 89 · raw

@+own:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Cli -> @+ts:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Cli> -> 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Cli

a tool of a ledger, after the upgrade

def tools.back source · line 93 · raw

@ts:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Cli> -> @+js:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Cli> -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Cli>

every tool of a ledger, after the upgrade

def ledger.back source · line 101 · raw

@mm:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> @joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest

a ledger after the upgrade, every pin taken from the joint ledger

def array.items source · line 110 · raw

@ts:List<&2, String> -> String

texts written as a TOML array of strings

def entries.text source · line 120 · raw

@es:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Entry> -> List<&2, String>

every entry as it was written

def paths.text source · line 128 · raw

@ps:List<&2, List<&2, String>> -> List<&2, String>

every path as it was written

def spec.text source · line 136 · raw

@spec:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Spec -> String

the [workspace] table, as it says what it says

def root.text source · line 143 · raw

@+mm:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> @+spec:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Spec -> @+root:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Root -> String

the root's ledger as a file: its package table when it has one, which a virtual root does not, its dependencies and tools, and its [workspace]

def write.if source · line 152 · raw

@+mm:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> @+joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> @+at:String -> @+text:String -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

a ledger written back when the upgrade changed what it holds, and left as it was otherwise

def member.write source · line 157 · raw

@rd:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Read -> @+ds:List<&2, String> -> @+joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

a member's ledger, written back at its directory's ez.toml

def found.pick source · line 165 · raw

@hit:Bool -> @+text:String -> @+ds:List<&2, String> -> @+joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

a member's ledger written back, or, for another's, nothing

def found.write source · line 173 · raw

@lg:Maybe<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Ledger> -> @+text:String -> @+dirs:List<&2, List<&2, String>> -> @+joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

one ez.toml git listed, written back when it is a member's

def members.write source · line 187 · raw

@fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Found> -> @+dirs:List<&2, List<&2, String>> -> @+joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

every member's ledger the upgrade changed, written back

def root.write source · line 200 · raw

@rd:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Read -> @+spec:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Spec -> @+root:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Root -> @+joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

the root's ledger, written back when the upgrade changed it

def writes.members source · line 209 · raw

@ms:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Members -> @+text:String -> @+spec:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Spec -> @+fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Found> -> @+joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Manifest -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

every ledger the upgrade changed, the root's first, once the member set is known

def writes.joint source · line 224 · raw

@joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Read -> @+text:String -> @+spec:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Spec -> @+fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Found> -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

every ledger the upgrade changed, once the joint ledger it leaves was read

def writes source · line 232 · raw

@back:Back -> @joint:0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Read -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

every ledger the upgrade changed, from the joint ledger it leaves

def effect.write source · line 240 · raw

@hit:Bool -> @at:String -> @text:String -> @ws:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect> -> @rest:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect> -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

a write kept, or, when it is of ez.toml, the ledgers' in its place

def effect.back source · line 254 · raw

@effect:0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect -> @+ws:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect> -> @rest:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect> -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

one effect of the plan: the write of ez.toml replaced by the ledgers'

def effects.back source · line 268 · raw

@es:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect> -> @+ws:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect> -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect>

every effect, with the write of ez.toml replaced

def plan.back source · line 277 · raw

@pl:0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Plan -> @+ws:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect> -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Plan

the plan with its write of ez.toml replaced by the ledgers'

def files.of source · line 289 · raw

@world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source>

the committed files a World lists

def up.moves source · line 296 · raw

@+ms:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/moved.Shift> -> @+text:String -> @+fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Found> -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> Up

an upgrade at a workspace root, once its moves are known: the World with every committed file rewritten by them, and the writes of the files they change

def up.of source · line 303 · raw

@+text:String -> @+fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Found> -> @+lock:String -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> Up

an upgrade at a workspace root: every member it moves (ws/moved.bend), its import lines rewritten, until none moves further

def up.world source · line 307 · raw

@got:Up -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World

the World an upgrade plans on

def world.at source · line 313 · raw

@up:Bool -> @+text:String -> @+fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Found> -> @+lock:String -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World

the World ez lock plans on at a workspace root: a plain lock's as it is, and an upgrade's with every moved member's import lines rewritten

def plans.on source · line 321 · raw

@back:Back -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World

the World ez lock plans on

def stale.at source · line 332 · raw

@up:Bool -> @+lock:String -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> String

why a plain lock at a workspace root refuses before it asks anything: a committed line names the hash the lock being rewritten records for a member that has moved since. "" when it does not, and always for an upgrade, which rewrites the line, and for a project of its own.

def stale source · line 340 · raw

@back:Back -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> String

and at the root as the command found it

def refused source · line 348 · raw

@+why:String -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Plan

the plan that refuses, writing nothing

def edits.put source · line 352 · raw

@refuses:Bool -> @eds:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Effect> -> @pl:0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Plan -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Plan

the files an upgrade rewrites, written ahead of the plan, unless it refuses

def plan.up source · line 363 · raw

@got:Up -> @+back:Back -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Plan

an upgrade's plan on the World it rewrote: the files it rewrote written first, so a source the lock planner rewrites too is left as the planner writes it, and then the planner's plan with the ledgers written back

def plan.plain source · line 368 · raw

@fine:Bool -> @+why:String -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Plan

a plain lock's plan, once it is known whether a line is stale

def plan.at source · line 376 · raw

@up:Bool -> @+back:Back -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Plan

what ez lock runs at a workspace root, under --upgrade or not

def plan source · line 398 · raw

@back:Back -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Plan

what ez lock runs: for a project of its own, the plan the lock planner makes; at a workspace root, the plan it makes on the joint ledger, with, under --upgrade, every moved member's import lines rewritten and every ledger the upgrade changed written back in place of the joint one. A plain lock writes no ledger, so its plan is as it was, unless a line names a moved member's old hash, which it refuses.

def step.plain source · line 406 · raw

@fine:Bool -> @+why:String -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Step

the step a plain lock takes, once it is known whether a line is stale

def step source · line 415 · raw

@+back:Back -> @+world:0xe21073738926f8a159714d5cdaf60edb/src/lock/world.World -> 0xe21073738926f8a159714d5cdaf60edb/src/lock/plan.Step

the lock planner's step on the World ez lock plans on: its questions, or its plan. A plain lock with a stale line asks nothing and refuses.