diff --git a/rust/hg-core/src/dirstate_tree/on_disk.rs b/rust/hg-core/src/dirstate_tree/on_disk.rs --- a/rust/hg-core/src/dirstate_tree/on_disk.rs +++ b/rust/hg-core/src/dirstate_tree/on_disk.rs @@ -415,9 +415,9 @@ impl Node { fn synthesize_unix_mode(&self) -> u32 { let file_type = if self.flags().contains(Flags::MODE_IS_SYMLINK) { - libc::S_IFLNK + libc::S_IFLNK as u32 } else { - libc::S_IFREG + libc::S_IFREG as u32 }; let permissions = if self.flags().contains(Flags::MODE_EXEC_PERM) { 0o755 diff --git a/rust/hg-core/src/vfs.rs b/rust/hg-core/src/vfs.rs --- a/rust/hg-core/src/vfs.rs +++ b/rust/hg-core/src/vfs.rs @@ -193,3 +193,13 @@ pub(crate) fn is_on_nfs_mount(path: impl r == 0 && buf.f_type as u32 == libc::NFS_SUPER_MAGIC as u32 } } + +/// Similar to what Cargo does; although detecting NFS (or non-local +/// file systems) _should_ be possible on other operating systems, +/// we'll just assume that mmap() works there, for now; after all, +/// _some_ functionality is better than a compile error, i.e. none at +/// all +#[cfg(not(target_os = "linux"))] +pub(crate) fn is_on_nfs_mount(_path: impl AsRef) -> bool { + false +}