Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdf78e4f826

README.md

sourceControl

The editor's Source Control panel (Content menu): the open world's version state over the world.* namespace.

  • The branch and its head in the toolbar; the branch name opens the branch menu, the refresh button reads the status again.
  • The commit box and Push / Pull stay above the list while it scrolls, and the outcome of the last action shows below them, so the line appearing never moves a control. The message field is emptied once a commit lands.
  • Commit commits what is staged (an install or a library update staged counts). With nothing staged it makes no commit and says so, naming the changes to stage (or the unsaved scene edits to save first). A commit names its id and the entries it holds, and the unsaved scene edits it left out. Commit and Push run one at a time: a press while either runs does nothing.
  • Push names the commits it published (those above the newest one the remote holds) by their messages, the branch and the remote head, and the changes it left on this machine because no commit holds them.
  • One list of four sections, each folded by its header: Staged and Changes (rows grouped by the asset they belong to, with Stage, Unstage and Discard on rows and Stage All, Unstage All and Discard All on section headers (Discard All takes the whole list back in one operation, files no commit holds included, the world's .world_settings and .world_entrypoint.luau excepted while no commit holds them; each press asks twice); each scene's unsaved edits (its autosave overlay) show as one <scene>: N unsaved scene edits entry that counts in Changes, with Save (writes the edits into the scene file, a change to stage; while play runs it makes no save and says to press Stop first) and Discard; a click on a file opens its diff in the Code panel), Installed (each installed asset as one entry, to stage or discard as one) and History (the recent commits; a commit row opens its diff).

Cost

The list is windowed: every row is one height, and a build creates widgets for the rows in view and a margin around them, so a build and its layout cost the size of the window however many files changed. displayRows flattens the sections into the rows the list windows over, and windowBounds names the band of them that exists as widgets.

The status is read when the source tree was written since the last read (a vfs.watch on /zero/source/ marks it), after an action of this panel, on a branch switch and on the refresh button, at most once per five seconds. A read that finds what the panel already shows changes nothing on screen. The reads, and the grouping and flattening of their rows, run across frames through modules.frame_budget, a few milliseconds of each.