rust: use `entry.tracked()` directly
authorRaphaël Gomès <rgomes@octobus.net>
Tue, 12 Apr 2022 17:26:23 +0200
changeset 49136 3f5e207f78be
parent 49135 a1fce5003ff4
child 49137 66e22a4d856b
rust: use `entry.tracked()` directly This is the new API Differential Revision: https://phab.mercurial-scm.org/D12534
rust/hg-core/src/dirstate_tree/dirstate_map.rs
rust/hg-core/src/dirstate_tree/on_disk.rs
rust/hg-core/src/operations/list_tracked_files.rs
rust/hg-core/src/repo.rs
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Tue Apr 12 17:25:38 2022 +0200
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Tue Apr 12 17:26:23 2022 +0200
@@ -477,7 +477,7 @@
         let parents = parse_dirstate_entries(
             map.on_disk,
             |path, entry, copy_source| {
-                let tracked = entry.state().is_tracked();
+                let tracked = entry.tracked();
                 let node = Self::get_or_insert_node_inner(
                     map.on_disk,
                     &mut map.unreachable_bytes,
--- a/rust/hg-core/src/dirstate_tree/on_disk.rs	Tue Apr 12 17:25:38 2022 +0200
+++ b/rust/hg-core/src/dirstate_tree/on_disk.rs	Tue Apr 12 17:26:23 2022 +0200
@@ -587,7 +587,7 @@
     ) -> Result<(), DirstateV2ParseError> {
         for node in read_nodes(on_disk, nodes)? {
             if let Some(entry) = node.entry()? {
-                if entry.state().is_tracked() {
+                if entry.tracked() {
                     f(node.full_path(on_disk)?)
                 }
             }
--- a/rust/hg-core/src/operations/list_tracked_files.rs	Tue Apr 12 17:25:38 2022 +0200
+++ b/rust/hg-core/src/operations/list_tracked_files.rs	Tue Apr 12 17:26:23 2022 +0200
@@ -51,7 +51,7 @@
                 let _parents = parse_dirstate_entries(
                     &self.content,
                     |path, entry, _copy_source| {
-                        if entry.state().is_tracked() {
+                        if entry.tracked() {
                             files.push(path)
                         }
                         Ok(())
--- a/rust/hg-core/src/repo.rs	Tue Apr 12 17:25:38 2022 +0200
+++ b/rust/hg-core/src/repo.rs	Tue Apr 12 17:26:23 2022 +0200
@@ -401,7 +401,7 @@
 
     pub fn has_subrepos(&self) -> Result<bool, DirstateError> {
         if let Some(entry) = self.dirstate_map()?.get(HgPath::new(".hgsub"))? {
-            Ok(entry.state().is_tracked())
+            Ok(entry.tracked())
         } else {
             Ok(false)
         }