Skip to content

Commit 50b7221

Browse files
committed
Copy: Unify volume_copy on APFS clone + generic streaming pipe
`volume_strategy::copy_single_path` collapses from three branches (local, import, export, stream) to one generic streaming pipe — plus the APFS clonefile fast path handled upstream in `copy_between_volumes`. Directories are walked here so the user can cancel between files; per-file transfers drive the destination's `write_from_stream`. Preserves all existing write-progress event emissions, cancellation semantics, per-file size tracking, and `.cmdr-tmp-*` temp-file behavior — only the dispatch logic is different. Added `#[allow(clippy::print_stdout, clippy::needless_update)]` to the pre-existing `phase4_bench_baseline_smb_to_local_100_tiny_files` bench so clippy stays clean with `-D warnings`; the `println!`s are intentional for `--nocapture` reports.
1 parent eb99c37 commit 50b7221

2 files changed

Lines changed: 130 additions & 275 deletions

File tree

apps/desktop/src-tauri/src/file_system/write_operations/volume_copy.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,11 @@ mod tests {
14491449

14501450
#[tokio::test]
14511451
#[ignore = "Phase 4 baseline — requires QNAP at 192.168.1.111 and SMB2_TEST_NAS_PASSWORD env var"]
1452+
#[allow(
1453+
clippy::print_stdout,
1454+
clippy::needless_update,
1455+
reason = "Bench test prints a timing report by design (run with --nocapture); the struct-update is intentional for future-proofing."
1456+
)]
14521457
async fn phase4_bench_baseline_smb_to_local_100_tiny_files() {
14531458
use crate::file_system::volume::LocalPosixVolume;
14541459
use crate::file_system::volume::smb::connect_smb_volume;
@@ -1461,7 +1466,7 @@ mod tests {
14611466
.expect("SMB2_TEST_NAS_PASSWORD not set. Copy smb2/.env.example to smb2/.env, or set in your shell.");
14621467

14631468
// ── Set up source (SMB) ───────────────────────────────────────
1464-
let smb_setup_start = std::time::Instant::now();
1469+
let smb_setup_start = Instant::now();
14651470
let smb_volume = connect_smb_volume(
14661471
"naspi",
14671472
"/Volumes/naspi-bench-p4",
@@ -1499,7 +1504,7 @@ mod tests {
14991504
..Default::default()
15001505
};
15011506

1502-
let copy_start = std::time::Instant::now();
1507+
let copy_start = Instant::now();
15031508
let result = copy_volumes_with_progress(
15041509
&events,
15051510
"phase4-bench",
@@ -1541,7 +1546,7 @@ mod tests {
15411546
return Some(p);
15421547
}
15431548
// Fall back: read from the smb2 crate's .env if present.
1544-
let smb2_env_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
1549+
let smb2_env_path = Path::new(env!("CARGO_MANIFEST_DIR"))
15451550
.parent() // src-tauri -> desktop
15461551
.and_then(|p| p.parent()) // desktop -> apps
15471552
.and_then(|p| p.parent()) // apps -> cmdr

0 commit comments

Comments
 (0)