changeset 48155:b2af515b4faf

dirstate-item: drop the legacy new_merged constructor Nobody is calling it anymore. Its purposes has been filled. Differential Revision: https://phab.mercurial-scm.org/D11599
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Oct 2021 09:14:10 +0200
parents 7a8c9869e4fe
children d342815ff827
files mercurial/cext/parsers.c mercurial/pure/parsers.py rust/hg-core/src/dirstate/entry.rs rust/hg-cpython/src/dirstate/item.rs
diffstat 4 files changed, 0 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/parsers.c	Fri Oct 01 09:12:52 2021 +0200
+++ b/mercurial/cext/parsers.c	Fri Oct 01 09:14:10 2021 +0200
@@ -364,24 +364,6 @@
 	return (PyObject *)t;
 };
 
-/* constructor to help legacy API to build a new "merged" item
-
-Should eventually be removed */
-static PyObject *dirstate_item_new_merged(PyTypeObject *subtype)
-{
-	dirstateItemObject *t;
-	t = (dirstateItemObject *)subtype->tp_alloc(subtype, 1);
-	if (!t) {
-		return NULL;
-	}
-	t->flags = (dirstate_flag_wc_tracked | dirstate_flag_p1_tracked |
-	            dirstate_flag_p2_info);
-	t->mode = 0;
-	t->size = 0;
-	t->mtime = 0;
-	return (PyObject *)t;
-};
-
 /* constructor to help legacy API to build a new "from_p2" item
 
 Should eventually be removed */
@@ -513,9 +495,6 @@
     {"new_added", (PyCFunction)dirstate_item_new_added,
      METH_NOARGS | METH_CLASS,
      "constructor to help legacy API to build a new \"added\" item"},
-    {"new_merged", (PyCFunction)dirstate_item_new_merged,
-     METH_NOARGS | METH_CLASS,
-     "constructor to help legacy API to build a new \"merged\" item"},
     {"new_from_p2", (PyCFunction)dirstate_item_new_from_p2,
      METH_NOARGS | METH_CLASS,
      "constructor to help legacy API to build a new \"from_p2\" item"},
--- a/mercurial/pure/parsers.py	Fri Oct 01 09:12:52 2021 +0200
+++ b/mercurial/pure/parsers.py	Fri Oct 01 09:14:10 2021 +0200
@@ -117,14 +117,6 @@
         return cls(wc_tracked=True)
 
     @classmethod
-    def new_merged(cls):
-        """constructor to help legacy API to build a new "merged" item
-
-        Should eventually be removed
-        """
-        return cls(wc_tracked=True, p1_tracked=True, p2_info=True)
-
-    @classmethod
     def new_from_p2(cls):
         """constructor to help legacy API to build a new "from_p2" item
 
--- a/rust/hg-core/src/dirstate/entry.rs	Fri Oct 01 09:12:52 2021 +0200
+++ b/rust/hg-core/src/dirstate/entry.rs	Fri Oct 01 09:14:10 2021 +0200
@@ -129,16 +129,6 @@
         }
     }
 
-    pub fn new_merged() -> Self {
-        Self {
-            flags: Flags::WDIR_TRACKED
-                | Flags::P1_TRACKED // might not be true because of rename ?
-                | Flags::P2_INFO, // might not be true because of rename ?
-            mode_size: None,
-            mtime: None,
-        }
-    }
-
     pub fn new_normal(mode: i32, size: i32, mtime: i32) -> Self {
         Self {
             flags: Flags::WDIR_TRACKED | Flags::P1_TRACKED,
--- a/rust/hg-cpython/src/dirstate/item.rs	Fri Oct 01 09:12:52 2021 +0200
+++ b/rust/hg-cpython/src/dirstate/item.rs	Fri Oct 01 09:14:10 2021 +0200
@@ -145,12 +145,6 @@
     }
 
     @classmethod
-    def new_merged(_cls) -> PyResult<Self> {
-        let entry = DirstateEntry::new_merged();
-        DirstateItem::create_instance(py, Cell::new(entry))
-    }
-
-    @classmethod
     def new_from_p2(_cls) -> PyResult<Self> {
         let entry = DirstateEntry::new_from_p2();
         DirstateItem::create_instance(py, Cell::new(entry))