MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / ingest_session_manifest

Method ingest_session_manifest

atomic-repository/src/repository/changes.rs:378–392  ·  view source on GitHub ↗

Store a session manifest received from another repository. Idempotent: storing the same content hash twice is a no-op. The convenience head advances to this manifest for its session ID.

(
        &self,
        manifest: &atomic_core::change::session::SessionManifest,
    )

Source from the content-addressed store, hash-verified

376 /// Idempotent: storing the same content hash twice is a no-op. The
377 /// convenience head advances to this manifest for its session ID.
378 pub fn ingest_session_manifest(
379 &self,
380 manifest: &atomic_core::change::session::SessionManifest,
381 ) -> Result<Hash, RepositoryError> {
382 let mut txn = self
383 .pristine
384 .write_txn()
385 .map_err(|e| RepositoryError::Database(e.to_string()))?;
386 let hash = txn
387 .save_session_manifest(manifest)
388 .map_err(|e| RepositoryError::Database(e.to_string()))?;
389 txn.commit()
390 .map_err(|e| RepositoryError::Database(e.to_string()))?;
391 Ok(hash)
392 }
393
394 /// Rebuild session indexes from stored provenance graphs.
395 ///

Calls 3

write_txnMethod · 0.80
save_session_manifestMethod · 0.80
commitMethod · 0.80