Skip to content

Returns the hashes of the changes that this change depends on (i.e., its parent changes in the causal graph). The first change in a document has no dependencies.

Usage

am_change_deps(change)

Arguments

change

An am_change object (from am_get_changes() or am_change_from_bytes())

Value

A list of raw vectors (change hashes), each 32 bytes. Returns an empty list for the first change in a document.

Examples

doc <- am_create()
am_put(doc, AM_ROOT, "x", 1)
am_commit(doc, "First")
am_put(doc, AM_ROOT, "y", 2)
am_commit(doc, "Second")

history <- am_get_changes(doc)
deps1 <- am_change_deps(history[[1]])
deps1
#> list()

deps2 <- am_change_deps(history[[2]])
deps2
#> [[1]]
#>  [1] 52 62 aa 35 75 ab e2 81 67 e9 c5 32 6a 0f 25 bf 0c b3 fe 01 ba 68
#> [23] 74 fe 48 11 6d 70 ae 44 93 dc
#> 

am_close(doc)