Skip to content
Tools/Cloud Sync/apply_pull_changeset

apply_pull_changeset

Apply cloud changes to the local `.upg` file. Takes cloud nodes and edges (from `export_upg_document` on the cloud server), computes the diff, merges into the local graph, and updates `.upg-sync` with new mappings. `strategy`: `cloud_wins` (default), `local_wins`, or `merge` (reports conflicts without resolving).

Cloud Syncnon-atomic. Node/edge mutations apply incrementally; a partial failure mid-application leaves the graph in a half-merged state. The `.upg-sync` file is updated after the merge sweep so its hashes reflect whatever landed.

Arguments

cloud_nodesarrayrequired

All cloud nodes (from export_upg_document)

cloud_edgesarrayrequired

All cloud edges (from export_upg_document)

cloud_product_idstringrequired

Cloud product ID

cloud_endpointstringoptional

Cloud endpoint URL (e.g. https://cloud.unifiedproductgraph.org)

strategystringoptional

Conflict resolution: cloud_wins (default), local_wins, or merge (report conflicts without resolving)

cloud_winslocal_winsmerge

Returns

Shape
{ nodes_created, nodes_updated, nodes_deleted, edges_created, edges_deleted, strategy, conflicts?, message? }

Warnings

Mutates the active product. Always call `get_workspace_info` first to confirm the right product is loaded; otherwise cloud changes land in the wrong file. `merge` strategy returns conflicts without applying them; the caller must re-run with `cloud_wins`/`local_wins` to commit.

See Also