Skip to main content

revert_changes

Function revert_changes 

pub fn revert_changes(
    doc: &mut AutoCommit,
    changes: &[(ChangeHash, String)],
    authors: &AuthorDirectory,
) -> Result<Vec<RevertOutcome>, RevertError>
Expand description

Undo several changes, each on its own, into one open transaction: changes pairs each change with the actor hex whose work it is, newest first. Every revert is planned before any is written, because reading the history closes the open transaction, which would commit the first revert as a change of its own.

As with revert_run the caller commits, and must consult each outcome’s RevertOutcome::kept before saying “undone”.

§Errors

RevertError::UnknownRun when a change is not in doc.