Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdf78e4f826

README.md

zm.checkout

git checkout.

  • zm.checkout("feature") switches this session to feature. Your uncommitted changes and staged entries come with you; a switch that would replace a path you changed with a different version refuses with git's message naming the paths, and nothing moves — commit or zm.stash first. Another caller's uncommitted changes stay on the branch they were made on. Returns once the branch's content has landed.
  • zm.checkout("feature", { create = true }) creates feature at HEAD (or start) and switches to it.
  • In an agent's own client the user's client switches to the branch once this one has (its play/edit mode stays its own); { follow = false } leaves it where it is. In the user's client follow is false, and in a sub-client made with client create it follows only with { follow = true }. The user's client switches on its own time, so the call returns once this client has switched; the engine state's split lists a sub-client that is on another world or branch than the user's client until the user's client has caught up, and a switch the user's client could not make is told to you as a notice. A switch to the branch this client is already on moves nothing.
  • zm.checkout("", { paths = { p }, theirs = true }) takes the merged-in side of an unmerged path whole (ours takes the session branch's); zm.add(p) then records the resolution.
  • zm.checkout("", { paths = { p }, rev = "HEAD~1" }) writes the path as that revision holds it, and stages it.