From 82ee6ada2e4192f7a45af699aadb05b671ba301a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Wed, 4 Nov 2026 01:13:43 +0100 Subject: [PATCH] fix(atomic): the vanished-backup error names the path it looked at --- crates/format/src/atomic.rs | 7 ++++--- crates/format/src/atomic/meta/tests.rs | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/format/src/atomic.rs b/crates/format/src/atomic.rs index 5f67e937d6..a454416dff 100644 --- a/crates/format/src/atomic.rs +++ b/crates/format/src/atomic.rs @@ -511,9 +511,10 @@ pub(crate) fn unresolved_recovery_error(dest: &Path, completion: &io::Error, res let msg = if restoration.kind() == io::ErrorKind::NotFound { format!( "cannot save {}: the previous version moved to its backup name but {RECOVERY_UNRESOLVED} from it \ - (completing the save failed: {completion}; the backup no longer exists: {restoration}), \ - so the destination currently holds no file under that name", - dest.display() + (completing the save failed: {completion}; the backup {} no longer exists: {restoration}), \ + so the destination currently holds no file under that name — check whether it was moved", + dest.display(), + recovery.display() ) } else { format!( diff --git a/crates/format/src/atomic/meta/tests.rs b/crates/format/src/atomic/meta/tests.rs index ec92062dc7..b9571ee93b 100644 --- a/crates/format/src/atomic/meta/tests.rs +++ b/crates/format/src/atomic/meta/tests.rs @@ -384,7 +384,8 @@ fn a_vanished_backup_is_reported_as_gone_rather_than_as_a_recovery_copy() { Path::new("/docs/.report.psd.9.pcsave.tmp"), ); let msg = e.to_string(); - assert!(msg.contains("no longer exists") && msg.contains("no file under that name"), "{msg}"); + assert!(msg.contains(".report.psd.9.pcsave.tmp") && msg.contains("no longer exists"), "the vanished backup is named: {msg}"); + assert!(msg.contains("no file under that name"), "{msg}"); assert!(!msg.contains("survives at"), "no recovery promise for a vanished backup: {msg}"); assert!(!msg.contains("the original file was not changed"), "{msg}"); }