rust/hg-core/src/lock.rs
changeset 52167 7be39c5110c9
parent 51864 db7dbe6f7bb2
--- a/rust/hg-core/src/lock.rs	Mon Jul 29 20:28:42 2024 +0200
+++ b/rust/hg-core/src/lock.rs	Mon Jul 29 20:47:43 2024 +0200
@@ -2,9 +2,11 @@
 
 use crate::errors::HgError;
 use crate::errors::HgResultExt;
+use crate::vfs::Vfs;
 use crate::vfs::VfsImpl;
 use std::io;
 use std::io::ErrorKind;
+use std::path::Path;
 
 #[derive(derive_more::From)]
 pub enum LockError {
@@ -65,7 +67,7 @@
         if !lock_should_be_broken(&lock_data) {
             return Err(LockError::AlreadyHeld);
         }
-        Ok(hg_vfs.remove_file(lock_filename)?)
+        Ok(hg_vfs.unlink(Path::new(lock_filename))?)
     })?
 }
 
@@ -99,7 +101,7 @@
 }
 
 fn unlock(hg_vfs: &VfsImpl, lock_filename: &str) -> Result<(), HgError> {
-    hg_vfs.remove_file(lock_filename)
+    hg_vfs.unlink(Path::new(lock_filename))
 }
 
 /// Return whether the process that is/was holding the lock is known not to be