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>)
| 914 | /// not hinted. Best-effort: silent if the server has no inventory |
| 915 | /// endpoint or nothing else to clone. |
| 916 | async fn hint_other_views(&self, remote: &HttpRemote, applied: &HashSet<String>) { |
| 917 | // A cheap ref advertisement (refs only, no change bodies) lists every |
| 918 | // view on the remote. |
| 919 | let Ok(adv) = remote.sync_pull(&SyncWants::advertise(vec![])).await else { |
| 920 | return; |
| 921 | }; |
| 922 | let others: Vec<String> = adv |
| 923 | .refs |
| 924 | .into_iter() |
| 925 | .map(|r| r.name) |
| 926 | .filter(|name| name != &self.view && !applied.contains(name)) |
| 927 | .collect(); |
| 928 | if others.is_empty() { |
| 929 | return; |
| 930 | } |
| 931 | |
| 932 | print_blank(); |
| 933 | print_hint(&format!( |
| 934 | "This remote has {} other {}: {}", |
| 935 | others.len(), |
| 936 | if others.len() == 1 { "view" } else { "views" }, |
| 937 | others.join(", ") |
| 938 | )); |
| 939 | print_hint( |
| 940 | "Clone them too with 'atomic clone --all-views', or list them with 'atomic view list --remote'.", |
| 941 | ); |
| 942 | } |
| 943 | |
| 944 | /// Async implementation of the clone command. |
| 945 | /// |
no test coverage detected