Function: transition()

transition(args: { lix: Lix; to: Pick<LixCommit, "id">; version?: Pick<{ commit_id: string; hidden?: LixGenerated<undefined | boolean>; id: LixGenerated<string>; inherits_from_version_id?: null | string; name: LixGenerated<string>; working_commit_id: LixGenerated<string>; }, "id">; }): Promise<{ change_set_id: string; id: string; }>

Transitions a version's state to match the state at toCommitId.

  • If versionId is omitted, operates on the active version.
  • If the version already points to toCommitId, it's a no-op and returns that commit.
  • Otherwise, creates a transition commit whose changeset transforms source → target, links it to both the source and target commits, and updates the version to point to it.

Parameters

ParameterType
args{ lix: Lix; to: Pick<LixCommit, "id">; version?: Pick<{ commit_id: string; hidden?: LixGenerated<undefined | boolean>; id: LixGenerated<string>; inherits_from_version_id?: null | string; name: LixGenerated<string>; working_commit_id: LixGenerated<string>; }, "id">; }
args.lixLix
args.toPick<LixCommit, "id">
args.version?Pick<{ commit_id: string; hidden?: LixGenerated<undefined | boolean>; id: LixGenerated<string>; inherits_from_version_id?: null | string; name: LixGenerated<string>; working_commit_id: LixGenerated<string>; }, "id">

Returns

Promise<{ change_set_id: string; id: string; }>

ON THIS PAGE