MCPcopy
hub / github.com/kopia/kopia / commitUpgrade

Method commitUpgrade

cli/command_repository_upgrade.go:486–500  ·  view source on GitHub ↗

commitUpgrade is the upgrade CLI phase that commits the upgrade and removes the lock after the actual upgrade phase has been run successfully. We will not end up here if any of the prior phases have failed. This will also cleanup and backups used for the rollback mechanism, so we cannot rollback aft

(ctx context.Context, rep repo.DirectRepositoryWriter)

Source from the content-addressed store, hash-verified

484// cleanup and backups used for the rollback mechanism, so we cannot rollback
485// after this phase.
486func (c *commandRepositoryUpgrade) commitUpgrade(ctx context.Context, rep repo.DirectRepositoryWriter) error {
487 if c.commitMode == commitModeNeverCommit {
488 log(ctx).Info("Commit mode is set to 'never'. Skipping commit.")
489 return nil
490 }
491
492 if err := rep.FormatManager().CommitUpgrade(ctx); err != nil {
493 return errors.Wrap(err, "error finalizing upgrade")
494 }
495 // we need to reopen the repository after this point
496
497 log(ctx).Info("Repository has been successfully upgraded.")
498
499 return nil
500}

Callers

nothing calls this directly

Calls 3

InfoMethod · 0.80
CommitUpgradeMethod · 0.80
FormatManagerMethod · 0.65

Tested by

no test coverage detected