Learn R Programming

automerge (version 0.2.1)

am_commit: Commit pending changes

Description

Commits all pending operations in the current transaction, creating a new change in the document's history. Commits can include an optional message (like a git commit message) and timestamp.

Usage

am_commit(doc, message = NULL, time = NULL)

Value

The document doc (invisibly)

Arguments

doc

An Automerge document

message

Optional commit message (character string)

time

Optional timestamp (POSIXct). If NULL, uses current time.

Examples

Run this code
doc <- am_create()
am_put(doc, AM_ROOT, "key", "value")
am_commit(doc, "Add initial data")

# Commit with specific timestamp
am_commit(doc, "Update", Sys.time())

am_close(doc)

Run the code above in your browser using DataLab