Skip to main content

Module revert

Module revert 

Source
Expand description

Reverting one change: undo’s edits and the parts it keeps (reservoir plan V2). Reverting one change: the edits that put back what a change altered, leaving alone whatever changed after it.

Reservoir plan V2, §7 items 17 and 18. A change’s own edits name what it touched: nodes, the relations from one node to another, the field layer and the import records. For each such part, the graph just before the change, just after it, and now are compared. A part that still reads as the change left it goes back to how it stood before; a part changed since is kept and reported. The edits are ordinary ones (a retitle, a relation set back), so a Timeline reads an undo like any other change. Previews (node images) are experience, not truth, and are left alone.

Structs§

Revert
The edits that revert a change, and the parts left as they are.
Touched
What a set of edits names: nodes, node pairs, and the graph-level stores.

Enums§

Part
One part of the graph a change can alter.

Functions§

part_edits
The edits that make part in graph read as value, given in part_value’s form, None for absent: how a merge-in applies a value someone supplied by hand. An error names a value that does not fit the part.
part_node
The node a node-scoped part belongs to, if it is one.
part_of
The part one revert or merge edit sets: what a caller picking edits by part (a merge-in applying one side of a conflict) filters on. An edit that recreates or removes a node is Part::Node; a whole resource record is Part::Resource. None for edits revert never writes (traversals, previews, layout hints and the like).
part_value
What part holds in graph, as JSON, or None when the graph does not hold it (a missing node, an absent tag or facet, no relations between two nodes). Two graphs agree on a part exactly when these are equal: how a merge-in tells a conflict from two sides making the same change.
recreate_node_edits
The edits that make node id again, whole, as it stands in graph: what a merge-in uses to bring a node across that its target never held. None when graph has no such node. Relations are not included.
revert_change
The edits that revert change, given the graph just before it (before), just after it (after) and now (live), and the parts kept because they changed since.