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

Function atomic_revision

atomic-agent/src/export.rs:443–448  ·  view source on GitHub ↗

Open the Atomic repository at `root` and return `(view_name, merkle_base32)` for the current view. Returns `None` if the directory is not an Atomic repository or any error occurs — callers treat absence of VCS info as non-fatal.

(root: &Path)

Source from the content-addressed store, hash-verified

441/// Returns `None` if the directory is not an Atomic repository or any error
442/// occurs — callers treat absence of VCS info as non-fatal.
443fn atomic_revision(root: &Path) -> Option<(String, String)> {
444 let repo = atomic_repository::Repository::open_existing(root).ok()?;
445 let view_name = repo.current_view().to_string();
446 let info = repo.get_view_info(&view_name).ok()?;
447 Some((view_name, info.state.to_base32()))
448}
449
450/// Inner fallible implementation of [`append_agent_trace`].
451fn try_append_agent_trace(record: &TraceRecord, root: &Path) -> std::io::Result<()> {

Calls 4

get_view_infoMethod · 0.80
okMethod · 0.45
current_viewMethod · 0.45
to_base32Method · 0.45