# HG changeset patch # User Pierre-Yves David # Date 1632852019 -7200 # Node ID d3eb5f50052cd484825b5102c40d21f4b219bfcb # Parent 7a2de2bd9fcd72543beed2a7501e1661caa68194 dirstate: drop the from_p2_removed method It it no longer in use. Differential Revision: https://phab.mercurial-scm.org/D11515 diff -r 7a2de2bd9fcd -r d3eb5f50052c mercurial/cext/parsers.c --- a/mercurial/cext/parsers.c Tue Sep 28 19:29:44 2021 +0200 +++ b/mercurial/cext/parsers.c Tue Sep 28 20:00:19 2021 +0200 @@ -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 */ diff -r 7a2de2bd9fcd -r d3eb5f50052c mercurial/pure/parsers.py --- a/mercurial/pure/parsers.py Tue Sep 28 19:29:44 2021 +0200 +++ b/mercurial/pure/parsers.py Tue Sep 28 20:00:19 2021 +0200 @@ -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 -r 7a2de2bd9fcd -r d3eb5f50052c rust/hg-core/src/dirstate/entry.rs --- a/rust/hg-core/src/dirstate/entry.rs Tue Sep 28 19:29:44 2021 +0200 +++ b/rust/hg-core/src/dirstate/entry.rs Tue Sep 28 20:00:19 2021 +0200 @@ -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 -r 7a2de2bd9fcd -r d3eb5f50052c rust/hg-cpython/src/dirstate/item.rs --- a/rust/hg-cpython/src/dirstate/item.rs Tue Sep 28 19:29:44 2021 +0200 +++ b/rust/hg-cpython/src/dirstate/item.rs Tue Sep 28 20:00:19 2021 +0200 @@ -85,11 +85,6 @@ Ok(self.entry(py).get().from_p2()) } - @property - def from_p2_removed(&self) -> PyResult { - Ok(self.entry(py).get().from_p2_removed()) - } - def v1_state(&self) -> PyResult { let (state, _mode, _size, _mtime) = self.entry(py).get().v1_data(); let state_byte: u8 = state.into();