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

Method hint_other_views

atomic-cli/src/commands/clone/command.rs:716–739  ·  view source on GitHub ↗

Print a hint listing the other views available on the remote. Views already cloned (the requested view and its ancestor chain) are not hinted. Best-effort: silent if the server has no inventory endpoint or nothing else to clone.

(&self, remote: &HttpRemote, applied: &HashSet<String>)

Source from the content-addressed store, hash-verified

714 /// not hinted. Best-effort: silent if the server has no inventory
715 /// endpoint or nothing else to clone.
716 async fn hint_other_views(&self, remote: &HttpRemote, applied: &HashSet<String>) {
717 let Ok(remote_views) = remote.list_views().await else {
718 return;
719 };
720 let others: Vec<String> = remote_views
721 .into_iter()
722 .map(|v| v.name)
723 .filter(|name| name != &self.view && !applied.contains(name))
724 .collect();
725 if others.is_empty() {
726 return;
727 }
728
729 print_blank();
730 print_hint(&format!(
731 "This remote has {} other {}: {}",
732 others.len(),
733 if others.len() == 1 { "view" } else { "views" },
734 others.join(", ")
735 ));
736 print_hint(
737 "Clone them too with 'atomic clone --all-views', or list them with 'atomic view list --remote'.",
738 );
739 }
740
741 /// Async implementation of the clone command.
742 ///

Callers 1

run_asyncMethod · 0.80

Calls 6

print_blankFunction · 0.85
print_hintFunction · 0.85
list_viewsMethod · 0.45
into_iterMethod · 0.45
containsMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected