#[non_exhaustive]pub enum Rollback {
Restored,
SkippedDiverged,
Failed(Error),
NotAttempted,
}Expand description
What the concurrency-safe op-log rollback did after a mutation failed — the
outcome Jj::rollback_to returns and Jj::transaction reports on its
TransactionError. It lets a caller tell a completed rollback apart from one
that was deliberately refused (a concurrent process’s work would have been
clobbered) or one that failed, instead of guessing by re-probing the op log.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Restored
The repo is back at the captured operation — either op restore ran, or the
closure failed before recording any operation, so nothing needed undoing.
SkippedDiverged
The rollback was skipped to avoid clobbering a concurrent process: the
operation log diverged between the capture and the restore (jj reconciled a
foreign operation with a “reconcile divergent operations” merge), so restoring
to the captured operation would have silently reverted that work. The repo is
left as the closure and the other process left it; the caller must reconcile.
Also returned when the captured operation is no longer within the probed
window (ROLLBACK_PROBE_LIMIT operations), so the range cannot be confirmed
safe to revert.
Failed(Error)
The rollback itself failed — the divergence probe or the op restore errored.
The repo may be left mid-transaction; the carried Error is the cause.
NotAttempted
No rollback was attempted: the transaction failed before it captured a
savepoint (e.g. the initial op_head capture itself failed),
so there was nothing to roll back.