MCPcopy Index your code
hub / github.com/kopia/kopia / runContentRewriteCommand

Method runContentRewriteCommand

cli/command_content_rewrite.go:43–62  ·  view source on GitHub ↗
(ctx context.Context, rep repo.DirectRepositoryWriter)

Source from the content-addressed store, hash-verified

41}
42
43func (c *commandContentRewrite) runContentRewriteCommand(ctx context.Context, rep repo.DirectRepositoryWriter) error {
44 c.svc.dangerousCommand()
45
46 contentIDs, err := toContentIDs(c.contentRewriteIDs)
47 if err != nil {
48 return err
49 }
50
51 _, err = maintenance.RewriteContents(ctx, rep, &maintenance.RewriteContentsOptions{
52 ContentIDRange: c.contentRange.contentIDRange(),
53 ContentIDs: contentIDs,
54 FormatVersion: c.contentRewriteFormatVersion,
55 PackPrefix: blob.ID(c.contentRewritePackPrefix),
56 Parallel: c.contentRewriteParallelism,
57 ShortPacks: c.contentRewriteShortPacks,
58 DryRun: c.contentRewriteDryRun,
59 }, c.contentRewriteSafety)
60
61 return errors.Wrap(err, "error rewriting contents")
62}
63
64func toContentIDs(s []string) ([]content.ID, error) {
65 var result []content.ID

Callers

nothing calls this directly

Calls 5

RewriteContentsFunction · 0.92
IDTypeAlias · 0.92
toContentIDsFunction · 0.85
contentIDRangeMethod · 0.80
dangerousCommandMethod · 0.65

Tested by

no test coverage detected