src/fetch/world.bend checks
raw source on the hub · import ezx@1.17.0.0/src/fetch/world.bend as World
fetch/world: what ez fetch reads. The directory the project is in
(here), which a relative path in the lock is anchored to; whether there is
an ez.toml, since fetch fills BEND_LIB for a project and nothing else; the
lock's text, None when there is no ez.lock.toml; and the answers to the
questions the planner (fetch/plan.bend) asked. There is no field for
BEND_LIB's path, the environment or the clock, because the planner reads
none of them.
A question is about one package of the lock, by its hash: the tree already
under BEND_LIB (Laid), or the package fetched from where the lock says it
comes from. A git package is the upgrade's own Clone question
(lock/up.bend), a shallow checkout at the pinned rev with every file's
text; a hub package is the lock's own question (lock/world.bend), the
hub's manifest and every file it names. Laid and a hub package are
answered the way the lock answers its questions, with a manifest and the
texts of the files it names, and a clone the way the upgrade answers
Clone.
A name the lock records is asked about too: the file bend reads its hash
from, $BEND_LIB/names/<nv> (Named), as it is, or that there is none.
A workspace member's package (laws/WorkspaceFetchChecksMembers.bend) is
asked about as the committed .bend files (Tree), answered the way ez
lock lists them, and the planner walks the member from its entry over
them itself.
4 imports
import Base import ../toml/toml.bend as T import ../lock/world.bend as W import ../lock/up.bend as Up
Types
type Ask source · line 32 · raw
Data
a question about one package of the lock, or one name it records
Laid@hash:String -> Ask
Git@hash:String -> @ask:0x9b437420348c999bf7a583a0fe7a67f5/src/lock/up.Ask -> Ask
Hub@ask:0x9b437420348c999bf7a583a0fe7a67f5/src/lock/world.Ask -> Ask
Named@nv:String -> Ask
Tree@hash:String -> @entry:String -> Ask
type Answer source · line 42 · raw
Data
the answer to one question: a manifest and the texts of the files it names, what a clone answered, or a names file's text, None when there is none
Read@answer:0x9b437420348c999bf7a583a0fe7a67f5/src/lock/world.Answer -> Answer
Said@answer:0x9b437420348c999bf7a583a0fe7a67f5/src/lock/up.Answer -> Answer
Held@got:Maybe<&2, String> -> Answer
Seen@listing:0x9b437420348c999bf7a583a0fe7a67f5/src/lock/world.Listing -> Answer
type Reply source · line 49 · raw
Data
one question, answered
Reply@ask:Ask -> @answer:Answer -> Reply
type World source · line 53 · raw
Data
everything ez fetch reads
World@here:String -> @ledger:Bool -> @lock:Maybe<&2, String> -> @replies:List<&2, Reply> -> World
type Heard source · line 123 · raw
Data
an answer looked up, or none yet
Heard@answer:Answer -> Heard
OpenHeard
Definitions
def toml source · line 57 · raw
String
the ledger's path, which is fixed
def lockfile source · line 61 · raw
String
the lock's path, which is fixed
def here source · line 66 · raw
@world:World -> String
the directory the project is in, which every relative path in the lock is read against
def ledger source · line 71 · raw
@world:World -> Bool
whether there is an ez.toml
def lock source · line 76 · raw
@world:World -> Maybe<&2, String>
the lock's text, None when there is no ez.lock.toml
def replies source · line 81 · raw
@world:World -> List<&2, Reply>
every question answered so far
def sects.of source · line 86 · raw
@got:Maybe<&2, String> -> List<&2, 0x9b437420348c999bf7a583a0fe7a67f5/src/toml/toml.Sect>
a lock's text, as tables; none when there is no lock
def sects source · line 94 · raw
@world:World -> List<&2, 0x9b437420348c999bf7a583a0fe7a67f5/src/toml/toml.Sect>
the lock, as tables
def hub.key source · line 98 · raw
@ask:0x9b437420348c999bf7a583a0fe7a67f5/src/lock/world.Ask -> String
a hub question as a key
def key source · line 109 · raw
@ask:Ask -> String
a question as a key. A lock's value never holds a newline, so the fields are kept apart by one.
def look.step source · line 129 · raw
@hit:Bool -> @answer:Answer -> @rest:(@_:Unit -> Heard) -> Heard
this answer when it is the question's, otherwise the rest's. The rest arrives as a thunk, so the first hit ends the scan.
def look source · line 137 · raw
@rs:List<&2, Reply> -> @+want:String -> Heard
the first answer given to a question
def heard source · line 145 · raw
@rs:List<&2, Reply> -> @ask:Ask -> Heard
the answer to a question, or none yet
def more source · line 149 · raw
@world:World -> @rs:List<&2, Reply> -> World
the World with more answers in it