mercurial/cext/parsers.c
changeset 47512 769037a279ec
parent 47509 80dc1d452993
child 47513 10e740292dff
--- a/mercurial/cext/parsers.c	Sat Jul 03 19:52:00 2021 +0200
+++ b/mercurial/cext/parsers.c	Sun Jul 04 03:29:20 2021 +0200
@@ -150,6 +150,16 @@
     {NULL} /* Sentinel */
 };
 
+static PyObject *dirstatetuple_get_state(dirstateTupleObject *self)
+{
+	return PyBytes_FromStringAndSize(&self->state, 1);
+};
+
+static PyGetSetDef dirstatetuple_getset[] = {
+    {"state", (getter)dirstatetuple_get_state, NULL, "state", NULL},
+    {NULL} /* Sentinel */
+};
+
 PyTypeObject dirstateTupleType = {
     PyVarObject_HEAD_INIT(NULL, 0)      /* header */
     "dirstate_tuple",                   /* tp_name */
@@ -180,7 +190,7 @@
     0,                                  /* tp_iternext */
     dirstatetuple_methods,              /* tp_methods */
     0,                                  /* tp_members */
-    0,                                  /* tp_getset */
+    dirstatetuple_getset,               /* tp_getset */
     0,                                  /* tp_base */
     0,                                  /* tp_dict */
     0,                                  /* tp_descr_get */