diff rust/hg-core/src/dirstate/entry.rs @ 48253:948570aa7630

dirstate: make DirstateItem constructor accept fallback value This could arguably goes in the previous changeset, but I wanted to keep that previous changeset small to focus more on the user code and the documentation. Differential Revision: https://phab.mercurial-scm.org/D11687
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 18 Oct 2021 20:02:05 +0200
parents 602c8e8411f5
children b874e8d81a98
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate/entry.rs	Mon Oct 18 20:02:15 2021 +0200
+++ b/rust/hg-core/src/dirstate/entry.rs	Mon Oct 18 20:02:05 2021 +0200
@@ -183,6 +183,8 @@
         p2_info: bool,
         mode_size: Option<(u32, u32)>,
         mtime: Option<u32>,
+        fallback_exec: Option<bool>,
+        fallback_symlink: Option<bool>,
     ) -> Self {
         if let Some((mode, size)) = mode_size {
             // TODO: return an error for out of range values?
@@ -196,6 +198,18 @@
         flags.set(Flags::WDIR_TRACKED, wdir_tracked);
         flags.set(Flags::P1_TRACKED, p1_tracked);
         flags.set(Flags::P2_INFO, p2_info);
+        if let Some(exec) = fallback_exec {
+            flags.insert(Flags::HAS_FALLBACK_EXEC);
+            if exec {
+                flags.insert(Flags::FALLBACK_EXEC);
+            }
+        }
+        if let Some(exec) = fallback_symlink {
+            flags.insert(Flags::HAS_FALLBACK_SYMLINK);
+            if exec {
+                flags.insert(Flags::FALLBACK_SYMLINK);
+            }
+        }
         Self {
             flags,
             mode_size,