MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / promoteNonWinningRevisionBody

Method promoteNonWinningRevisionBody

db/document.go:820–825  ·  view source on GitHub ↗

makeBodyActive moves a previously non-winning revision body from the rev tree to the document body

(ctx context.Context, revid string, loader RevLoaderFunc)

Source from the content-addressed store, hash-verified

818
819// makeBodyActive moves a previously non-winning revision body from the rev tree to the document body
820func (doc *Document) promoteNonWinningRevisionBody(ctx context.Context, revid string, loader RevLoaderFunc) {
821 // If the new revision is not current, transfer the current revision's
822 // body to the top level doc._body:
823 doc.UpdateBody(doc.getNonWinningRevisionBody(ctx, revid, loader))
824 doc.removeRevisionBody(ctx, revid)
825}
826
827func (doc *Document) pruneRevisions(ctx context.Context, maxDepth uint32, keepRev string) int {
828 numPruned, prunedTombstoneBodyKeys := doc.History.pruneRevisions(ctx, maxDepth, keepRev)

Calls 3

UpdateBodyMethod · 0.95
removeRevisionBodyMethod · 0.95

Tested by

no test coverage detected