--- a/mercurial/cext/parsers.c Wed Sep 15 11:13:46 2021 +0200
+++ b/mercurial/cext/parsers.c Wed Sep 15 18:05:39 2021 +0200
@@ -507,6 +507,17 @@
Py_RETURN_NONE;
}
+static PyObject *dirstate_item_set_tracked(dirstateItemObject *self)
+{
+ self->flags |= dirstate_flag_wc_tracked;
+ self->flags |= dirstate_flag_possibly_dirty;
+ /* size = None on the python size turn into size = NON_NORMAL when
+ * accessed. So the next line is currently required, but a some future
+ * clean up would be welcome. */
+ self->size = dirstate_v1_nonnormal;
+ Py_RETURN_NONE;
+}
+
static PyObject *dirstate_item_set_untracked(dirstateItemObject *self)
{
self->flags &= ~dirstate_flag_wc_tracked;
@@ -548,6 +559,8 @@
METH_NOARGS, "mark a file as \"possibly dirty\""},
{"set_clean", (PyCFunction)dirstate_item_set_clean, METH_VARARGS,
"mark a file as \"clean\""},
+ {"set_tracked", (PyCFunction)dirstate_item_set_tracked, METH_NOARGS,
+ "mark a file as \"tracked\""},
{"set_untracked", (PyCFunction)dirstate_item_set_untracked, METH_NOARGS,
"mark a file as \"untracked\""},
{NULL} /* Sentinel */