Learn R Programming

automerge (version 0.2.0)

am_get_history: Get document history

Description

Returns the full change history of the document as a list of change metadata. This provides a simpler interface than am_get_changes() for examining document history without needing to work with serialized changes directly.

Usage

am_get_history(doc)

Value

A list of raw vectors (serialized changes), one for each change in the document's history, in chronological order.

Arguments

doc

An Automerge document

Details

Note: A future implementation will add detailed change introspection functions to extract metadata like commit messages, timestamps, actor IDs, etc.

Examples

Run this code
doc <- am_create()
am_put(doc, AM_ROOT, "x", 1)
am_commit(doc, "Initial")
am_put(doc, AM_ROOT, "x", 2)
am_commit(doc, "Update")

history <- am_get_history(doc)
cat("Document history contains", length(history), "change(s)\n")

Run the code above in your browser using DataLab