# HG changeset patch # User Pierre-Yves David # Date 2021-09-28 17:15:46 # Node ID 870100c0209b02e492a2ae42d970123656d91816 # Parent 2943955304b343717de25e86bebbaca7dff2980e dirstate: drop the merged_removed method It it no longer in use. Differential Revision: https://phab.mercurial-scm.org/D11513 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 @@ static inline bool dirstate_item_c_merge (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_merge } }; -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 @@ static PyGetSetDef dirstate_item_getset[ {"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}, 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 @@ class DirstateItem(object): """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/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 @@ impl DirstateEntry { && !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/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 @@ py_class!(pub class DirstateItem |py| { } @property - def merged_removed(&self) -> PyResult { - Ok(self.entry(py).get().merged_removed()) - } - - @property def from_p2_removed(&self) -> PyResult { Ok(self.entry(py).get().from_p2_removed()) }