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] 03 04 ad c8 41 42 27 26 1d 17 ee c3 42 7c 4d 64 2e 33 21 1a a7 eb
#> [23] ba 29 73 3e 4a 15 94 87 4f d4
#> 

am_close(doc)