D11513: dirstate: drop the merged_removed method

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Sep 29 08:37:38 UTC 2021


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It it no longer in use.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/cext/parsers.c
  mercurial/pure/parsers.py
  rust/hg-core/src/dirstate/entry.rs
  rust/hg-cpython/src/dirstate/item.rs

CHANGE DETAILS

diff --git a/rust/hg-cpython/src/dirstate/item.rs b/rust/hg-cpython/src/dirstate/item.rs
--- a/rust/hg-cpython/src/dirstate/item.rs
+++ b/rust/hg-cpython/src/dirstate/item.rs
@@ -86,11 +86,6 @@
     }
 
     @property
-    def merged_removed(&self) -> PyResult<bool> {
-        Ok(self.entry(py).get().merged_removed())
-    }
-
-    @property
     def from_p2_removed(&self) -> PyResult<bool> {
         Ok(self.entry(py).get().from_p2_removed())
     }
diff --git a/rust/hg-core/src/dirstate/entry.rs b/rust/hg-core/src/dirstate/entry.rs
--- a/rust/hg-core/src/dirstate/entry.rs
+++ b/rust/hg-core/src/dirstate/entry.rs
@@ -178,10 +178,6 @@
             && !self.flags.contains(Flags::WDIR_TRACKED)
     }
 
-    pub fn merged_removed(&self) -> bool {
-        self.removed() && self.flags.contains(Flags::MERGED)
-    }
-
     pub fn from_p2_removed(&self) -> bool {
         self.removed() && self.flags.contains(Flags::CLEAN_P2)
     }
diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -352,15 +352,6 @@
         """True if the file has been removed"""
         return not self._wc_tracked and (self._p1_tracked or self._p2_tracked)
 
-    @property
-    def merged_removed(self):
-        """True if the file has been removed, but was "merged" initially
-
-        This property seems like an abstraction leakage and should probably be
-        dealt in this class (or maybe the dirstatemap)  directly.
-        """
-        return self.removed and self._merged
-
     def v1_state(self):
         """return a "state" suitable for v1 serialization"""
         if not (self._p1_tracked or self._p2_tracked or self._wc_tracked):
diff --git a/mercurial/cext/parsers.c b/mercurial/cext/parsers.c
--- a/mercurial/cext/parsers.c
+++ b/mercurial/cext/parsers.c
@@ -166,14 +166,6 @@
 	        (self->flags & dirstate_flag_merged));
 }
 
-static inline bool dirstate_item_c_merged_removed(dirstateItemObject *self)
-{
-	if (!dirstate_item_c_removed(self)) {
-		return false;
-	}
-	return (self->flags & dirstate_flag_merged);
-}
-
 static inline bool dirstate_item_c_from_p2(dirstateItemObject *self)
 {
 	if (!dirstate_item_c_tracked(self)) {
@@ -626,15 +618,6 @@
 	}
 };
 
-static PyObject *dirstate_item_get_merged_removed(dirstateItemObject *self)
-{
-	if (dirstate_item_c_merged_removed(self)) {
-		Py_RETURN_TRUE;
-	} else {
-		Py_RETURN_FALSE;
-	}
-};
-
 static PyObject *dirstate_item_get_from_p2(dirstateItemObject *self)
 {
 	if (dirstate_item_c_from_p2(self)) {
@@ -669,8 +652,6 @@
     {"state", (getter)dirstate_item_get_state, NULL, "state", NULL},
     {"tracked", (getter)dirstate_item_get_tracked, NULL, "tracked", NULL},
     {"added", (getter)dirstate_item_get_added, NULL, "added", NULL},
-    {"merged_removed", (getter)dirstate_item_get_merged_removed, NULL,
-     "merged_removed", NULL},
     {"merged", (getter)dirstate_item_get_merged, NULL, "merged", NULL},
     {"from_p2_removed", (getter)dirstate_item_get_from_p2_removed, NULL,
      "from_p2_removed", NULL},



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list