Skip to main content

merge_split_containers

Function merge_split_containers 

Source
pub fn merge_split_containers(
    doc: &mut AutoCommit,
    scope: Scope<'_>,
    founding: &[(String, ObjType)],
    app: &str,
) -> Result<bool, AutomergeError>
Expand description

Bring together a record whose root containers its devices each made of their own before its founding was the same everywhere: of every container founding names, the copies a merge left conflicting at the root, where it shows one and hides the rest with the items added to them. The items of each hidden copy are copied into the shown one, which every device picks alike: a map’s entries it lacks by key (an item’s id), and a list’s elements it holds fewer of than the hidden copy does, an element naming an id held once by it.

The change is the same on every device that holds the same history: made at time zero by an actor derived from the record (scope: its workspace, kind and id), the containers it brings together and the heads it is made on, which are its only dependencies, and named as the app app’s own edit of its record, the same everywhere. Two devices doing it at once from one history make one change, which a merge keeps once; two doing it from different histories make two, of which a list keeps an element naming an id once all the same. Opened again, a record brought together is not changed. Whether this changed anything.

§Errors

The record could not be written.