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>)
| 805 | /// not hinted. Best-effort: silent if the server has no inventory |
| 806 | /// endpoint or nothing else to clone. |
| 807 | async fn hint_other_views(&self, remote: &HttpRemote, applied: &HashSet<String>) { |
| 808 | // A cheap ref advertisement (refs only, no change bodies) lists every |
| 809 | // view on the remote. |
| 810 | let Ok(adv) = remote.sync_pull(&SyncWants::advertise(vec![])).await else { |
| 811 | return; |
| 812 | }; |
| 813 | let others: Vec<String> = adv |
| 814 | .refs |
| 815 | .into_iter() |
| 816 | .map(|r| r.name) |
| 817 | .filter(|name| name != &self.view && !applied.contains(name)) |
| 818 | .collect(); |
| 819 | if others.is_empty() { |
| 820 | return; |
| 821 | } |
| 822 | |
| 823 | print_blank(); |
| 824 | print_hint(&format!( |
| 825 | "This remote has {} other {}: {}", |
| 826 | others.len(), |
| 827 | if others.len() == 1 { "view" } else { "views" }, |
| 828 | others.join(", ") |
| 829 | )); |
| 830 | print_hint( |
| 831 | "Clone them too with 'atomic clone --all-views', or list them with 'atomic view list --remote'.", |
| 832 | ); |
| 833 | } |
| 834 | |
| 835 | /// Async implementation of the clone command. |
| 836 | /// |
no test coverage detected