| 393 | } |
| 394 | |
| 395 | func newRevCacheDelta(deltaBytes []byte, fromRevID string, toRevision DocumentRevision, deleted bool, toRevAttStorageMeta []AttachmentStorageMeta) RevisionDelta { |
| 396 | revDelta := RevisionDelta{ |
| 397 | ToRevID: toRevision.RevID, |
| 398 | DeltaBytes: deltaBytes, |
| 399 | AttachmentStorageMeta: toRevAttStorageMeta, |
| 400 | ToChannels: toRevision.Channels, |
| 401 | RevisionHistory: toRevision.History.parseAncestorRevisions(fromRevID), |
| 402 | HlvHistory: toRevision.HlvHistory, |
| 403 | ToDeleted: deleted, |
| 404 | } |
| 405 | if toRevision.CV != nil { |
| 406 | revDelta.ToCV = toRevision.CV.String() |
| 407 | } |
| 408 | revDelta.CalculateDeltaBytes() |
| 409 | return revDelta |
| 410 | } |
| 411 | |
| 412 | // This is the RevisionCacheLoaderFunc callback for the context's RevisionCache. |
| 413 | // Its job is to load a revision from the bucket when there's a cache miss. |