[Commented On] D12431: rust-dirstatemap: properly decrement counter for tracked descendants

baymax (Baymax, Your Personal Patch-care Companion) phabricator at mercurial-scm.org
Mon Apr 4 18:34:10 UTC 2022


baymax added a comment.
baymax updated this revision to Diff 32765.


  ✅ refresh by Heptapod after a successful CI run (🐙 💚)
  ⚠ This patch is intended for stable ⚠
  <img src="https://phab.mercurial-scm.org/file/data/5yyrdzk5a3noq3wk6e3a/PHID-FILE-dyocpitovew2lamcnkk4/source.gif" />

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D12431?vs=32760&id=32765

BRANCH
  stable

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D12431/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D12431

AFFECTED FILES
  rust/hg-core/src/dirstate_tree/dirstate_map.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/dirstate_tree/dirstate_map.rs b/rust/hg-core/src/dirstate_tree/dirstate_map.rs
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs
@@ -858,7 +858,9 @@
                     return Ok(None);
                 }
             } else {
-                let had_entry = node.data.has_entry();
+                let entry = node.data.as_entry();
+                let was_tracked = entry.map_or(false, |entry| entry.tracked());
+                let had_entry = entry.is_some();
                 if had_entry {
                     node.data = NodeData::None
                 }
@@ -867,10 +869,7 @@
                     node.copy_source = None
                 }
                 dropped = Dropped {
-                    was_tracked: node
-                        .data
-                        .as_entry()
-                        .map_or(false, |entry| entry.state().is_tracked()),
+                    was_tracked,
                     had_entry,
                     had_copy_source: node.copy_source.take().is_some(),
                 };



To: Alphare, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220404/8a1de5e8/attachment-0002.html>


More information about the Mercurial-patches mailing list