`atomic unrecord --dry-run` over PreviewMutation (UnrecordPreview). Only the bare form routes (absent = last change); a change argument needs the local resolver's exact semantics — see `unrecord`.
(change: Option<String>)
| 4932 | /// Only the bare form routes (absent = last change); a change argument |
| 4933 | /// needs the local resolver's exact semantics — see `unrecord`. |
| 4934 | pub fn unrecord_preview(change: Option<String>) -> CliResult<bool> { |
| 4935 | let Some(session) = Service::open()? else { |
| 4936 | return Ok(false); |
| 4937 | }; |
| 4938 | let target = change.map(|prefix| pb::ChangeRef { |
| 4939 | kind: Some(pb::change_ref::Kind::Prefix(prefix)), |
| 4940 | }); |
| 4941 | let request = pb::PreviewMutationRequest { |
| 4942 | repository: Some(session.reference.clone()), |
| 4943 | operation: Some(pb::preview_mutation_request::Operation::Unrecord( |
| 4944 | pb::UnrecordPreview { view: None, target }, |
| 4945 | )), |
| 4946 | }; |
| 4947 | let response = session.preview_mutation(request)?; |
| 4948 | for change in &response.changes { |
| 4949 | let hash = full_hash(&change.hash); |
| 4950 | print_warning(&format!("Would unrecord: {hash}")); |
| 4951 | } |
| 4952 | Ok(true) |
| 4953 | } |
| 4954 | |
| 4955 | /// Resolve a hash prefix to the full hash through the service layer — |
| 4956 | /// Log entries, newest first, the same resolution the in-process |
no test coverage detected