`atomic mv` over MoveFile — every form (--dry-run/--force ride the request).
(args: &super::mv::Move)
| 3469 | /// `atomic mv` over MoveFile — every form (--dry-run/--force ride the |
| 3470 | /// request). |
| 3471 | pub fn mv(args: &super::mv::Move) -> CliResult<bool> { |
| 3472 | let Some(session) = Service::open()? else { |
| 3473 | return Ok(false); |
| 3474 | }; |
| 3475 | let request = pb::MoveFileRequest { |
| 3476 | repository: Some(session.reference.clone()), |
| 3477 | meta: None, |
| 3478 | source: args.source.clone(), |
| 3479 | destination: args.destination.clone(), |
| 3480 | dry_run: args.dry_run, |
| 3481 | force: args.force, |
| 3482 | }; |
| 3483 | session.move_file(request)?; |
| 3484 | if args.dry_run { |
| 3485 | println!("Would move: {} → {}", args.source, args.destination); |
| 3486 | return Ok(true); |
| 3487 | } |
| 3488 | println!("Moving: {} → {}", args.source, args.destination); |
| 3489 | println!(); |
| 3490 | print_success("Moved 1 file"); |
| 3491 | println!(); |
| 3492 | print_hint("Run 'atomic record' to capture this move (inode/history preserved)"); |
| 3493 | Ok(true) |
| 3494 | } |
| 3495 | |
| 3496 | /// `atomic unrecord` over Unrecord — the non-dry-run forms, bare or |
| 3497 | /// with a change argument: the prefix rides the wire's ChangeRef prefix |
no test coverage detected