Skip to main content

apply

Function apply 

Source
pub fn apply(
    doc: &OpsDoc,
    target: &str,
    target_path: &str,
    declared_base: Option<&str>,
    host: &Host,
) -> Result<ApplyReport, PatchError>
Expand description

Apply doc to target.

declared_base is the base the caller supplied out of band; the document’s own base.inline is used when it has one. With neither, the target stands in for the base and the result is a naive application (NoBase).

Errors only when the caller supplied a base that is provably not the one the ops were computed from — merging against the wrong ancestor produces a confidently wrong answer, which is the one outcome worth refusing.