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

Function entry

atomic-cli/src/commands/view/list.rs:922–934  ·  view source on GitHub ↗

Build a `ViewEntry` for tests. Roots count their own changes as `change_count` (matching `get_view_info` for parentless views).

(name: &str, parent: Option<&str>, own: u64, current: &str)

Source from the content-addressed store, hash-verified

920 /// Build a `ViewEntry` for tests. Roots count their own changes as
921 /// `change_count` (matching `get_view_info` for parentless views).
922 fn entry(name: &str, parent: Option<&str>, own: u64, current: &str) -> ViewEntry {
923 ViewEntry {
924 name: name.to_string(),
925 parent: parent.map(|p| p.to_string()),
926 own_change_count: own,
927 change_count: own,
928 inherited_change_count: if parent.is_some() { 3 } else { 0 },
929 kind: if parent.is_some() { "draft" } else { "shared" },
930 state_short: "AAAAAAAAAAAA".to_string(),
931 is_current: name == current,
932 has_info: true,
933 }
934 }
935
936 #[test]
937 fn test_hierarchy_layout_three_deep() {

Calls

no outgoing calls

Tested by 3

test_root_line_formatFunction · 0.56