commit method

void commit()

Makes the change final: folders moved aside go to the trash, and the journal is removed.

Once the journal says the change committed, this never throws: what can't be tidied now is tidied by the next recover. A rollBack after it does nothing.

Implementation

void commit() {
  if (_state == _committed) return;
  _checkOpen();
  _state = _committed;
  try {
    _save();
  } on Object {
    _state = _started; // Not committed: a rollback still undoes it all.
    rethrow;
  }
  _finish();
}