# HG changeset patch # User Pierre-Yves David # Date 1633073113 -7200 # Node ID 20e41b3679535ce45c0ec5e199fc6c6edb23d90c # Parent 898de425bcd67571dcb983df3811b9140f974081 dirstate-item: drop the legacy new_possibly_dirty constructor Nobody is calling it anymore. Its purposes has been filled. Differential Revision: https://phab.mercurial-scm.org/D11605 diff -r 898de425bcd6 -r 20e41b367953 mercurial/cext/parsers.c --- a/mercurial/cext/parsers.c Fri Oct 01 09:24:48 2021 +0200 +++ b/mercurial/cext/parsers.c Fri Oct 01 09:25:13 2021 +0200 @@ -347,25 +347,6 @@ return (PyObject *)dirstate_item_from_v1_data(state, mode, size, mtime); }; -/* constructor to help legacy API to build a new "possibly" item - -Should eventually be removed */ -static PyObject *dirstate_item_new_possibly_dirty(PyTypeObject *subtype) -{ - /* We do all the initialization here and not a tp_init function because - * dirstate_item is immutable. */ - dirstateItemObject *t; - t = (dirstateItemObject *)subtype->tp_alloc(subtype, 1); - if (!t) { - return NULL; - } - t->flags = dirstate_flag_wc_tracked | dirstate_flag_p1_tracked; - t->mode = 0; - t->size = 0; - t->mtime = 0; - return (PyObject *)t; -}; - /* constructor to help legacy API to build a new "normal" item Should eventually be removed */ @@ -456,9 +437,6 @@ "True if the stored mtime would be ambiguous with the current time"}, {"from_v1_data", (PyCFunction)dirstate_item_from_v1_meth, METH_VARARGS | METH_CLASS, "build a new DirstateItem object from V1 data"}, - {"new_possibly_dirty", (PyCFunction)dirstate_item_new_possibly_dirty, - METH_NOARGS | METH_CLASS, - "constructor to help legacy API to build a new \"possibly_dirty\" item"}, {"new_normal", (PyCFunction)dirstate_item_new_normal, METH_VARARGS | METH_CLASS, "constructor to help legacy API to build a new \"normal\" item"}, diff -r 898de425bcd6 -r 20e41b367953 mercurial/pure/parsers.py --- a/mercurial/pure/parsers.py Fri Oct 01 09:24:48 2021 +0200 +++ b/mercurial/pure/parsers.py Fri Oct 01 09:25:13 2021 +0200 @@ -109,14 +109,6 @@ self._mtime = parentfiledata[2] @classmethod - def new_possibly_dirty(cls): - """constructor to help legacy API to build a new "possibly_dirty" item - - Should eventually be removed - """ - return cls(wc_tracked=True, p1_tracked=True) - - @classmethod def new_normal(cls, mode, size, mtime): """constructor to help legacy API to build a new "normal" item diff -r 898de425bcd6 -r 20e41b367953 rust/hg-core/src/dirstate/entry.rs --- a/rust/hg-core/src/dirstate/entry.rs Fri Oct 01 09:24:48 2021 +0200 +++ b/rust/hg-core/src/dirstate/entry.rs Fri Oct 01 09:25:13 2021 +0200 @@ -117,14 +117,6 @@ } } - pub fn new_possibly_dirty() -> Self { - Self { - flags: Flags::WDIR_TRACKED | Flags::P1_TRACKED, - mode_size: None, - mtime: None, - } - } - pub fn new_normal(mode: i32, size: i32, mtime: i32) -> Self { Self { flags: Flags::WDIR_TRACKED | Flags::P1_TRACKED, diff -r 898de425bcd6 -r 20e41b367953 rust/hg-cpython/src/dirstate/item.rs --- a/rust/hg-cpython/src/dirstate/item.rs Fri Oct 01 09:24:48 2021 +0200 +++ b/rust/hg-cpython/src/dirstate/item.rs Fri Oct 01 09:25:13 2021 +0200 @@ -139,12 +139,6 @@ } @classmethod - def new_possibly_dirty(_cls) -> PyResult { - let entry = DirstateEntry::new_possibly_dirty(); - DirstateItem::create_instance(py, Cell::new(entry)) - } - - @classmethod def new_normal(_cls, mode: i32, size: i32, mtime: i32) -> PyResult { let entry = DirstateEntry::new_normal(mode, size, mtime); DirstateItem::create_instance(py, Cell::new(entry))