CommitNode

class dsviper.CommitNode

Bases: object

One commit in the DAG, linked to the commits that follow it.

build() returns the whole DAG for a commit database; header() carries the label, type, parent and timestamp.

The node build() roots that DAG at is the one exception: it carries a label and a type like any other, and no commit backs it.

Note: Not directly instantiable.

static build(commit_database: CommitDatabase) → CommitNode

Return the DAG of commit_database, as linked CommitNode.

It is rooted at one node that no commit backs, and that root is what the walk starts from - so a database holding two commits answers three nodes. It stands for the state before anything was written: its commit_id is ValueCommitId.INVALID, commit_exists says False for it, and commit_header raises, a node without a commit having no header. CommitStateBuilder.state accepts that id and answers the initial state.

children() → list[CommitNode]

Return the list of childs.

header() → CommitHeader

Return the CommitHeader of this node - its label, type, parent and timestamp.