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

Function atomic_revision

atomic-agent/src/export.rs:442–447  ·  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

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

Calls 3

current_viewMethod · 0.80
get_view_infoMethod · 0.80
to_base32Method · 0.45