Patchwork D11515: dirstate: drop the from_p2_removed method

login
register
mail settings
Submitter phabricator
Date Sept. 29, 2021, 8:37 a.m.
Message ID <differential-rev-PHID-DREV-5u37mk55ajsbmcbekwwz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49839/
State Superseded
Headers show

Comments

phabricator - Sept. 29, 2021, 8:37 a.m.
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/D11515

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




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

Patch

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,10 +86,6 @@ 
     }
 
     @property
-    def from_p2_removed(&self) -> PyResult<bool> {
-        Ok(self.entry(py).get().from_p2_removed())
-    }
-
     def v1_state(&self) -> PyResult<PyBytes> {
         let (state, _mode, _size, _mtime) = self.entry(py).get().v1_data();
         let state_byte: u8 = state.into();
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 from_p2_removed(&self) -> bool {
-        self.removed() && self.flags.contains(Flags::CLEAN_P2)
-    }
-
     pub fn merged(&self) -> bool {
         self.flags.contains(Flags::WDIR_TRACKED | Flags::MERGED)
     }
diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -339,15 +339,6 @@ 
         return self._clean_p2
 
     @property
-    def from_p2_removed(self):
-        """True if the file has been removed, but was "from_p2" 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._clean_p2
-
-    @property
     def removed(self):
         """True if the file has been removed"""
         return not self._wc_tracked and (self._p1_tracked or self._p2_tracked)
diff --git a/mercurial/cext/parsers.c b/mercurial/cext/parsers.c
--- a/mercurial/cext/parsers.c
+++ b/mercurial/cext/parsers.c
@@ -174,14 +174,6 @@ 
 	return (self->flags & dirstate_flag_clean_p2);
 }
 
-static inline bool dirstate_item_c_from_p2_removed(dirstateItemObject *self)
-{
-	if (!dirstate_item_c_removed(self)) {
-		return false;
-	}
-	return (self->flags & dirstate_flag_clean_p2);
-}
-
 static inline char dirstate_item_c_v1_state(dirstateItemObject *self)
 {
 	if (dirstate_item_c_removed(self)) {
@@ -628,15 +620,6 @@ 
 	}
 };
 
-static PyObject *dirstate_item_get_from_p2_removed(dirstateItemObject *self)
-{
-	if (dirstate_item_c_from_p2_removed(self)) {
-		Py_RETURN_TRUE;
-	} else {
-		Py_RETURN_FALSE;
-	}
-};
-
 static PyObject *dirstate_item_get_removed(dirstateItemObject *self)
 {
 	if (dirstate_item_c_removed(self)) {
@@ -654,8 +637,6 @@ 
     {"tracked", (getter)dirstate_item_get_tracked, NULL, "tracked", NULL},
     {"added", (getter)dirstate_item_get_added, NULL, "added", 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},
     {"from_p2", (getter)dirstate_item_get_from_p2, NULL, "from_p2", NULL},
     {"removed", (getter)dirstate_item_get_removed, NULL, "removed", NULL},
     {NULL} /* Sentinel */