diff mercurial/cext/parsers.c @ 47513:10e740292dff

dirstate-entry: add a `merged` property Lets start to define and use more semantic property. Differential Revision: https://phab.mercurial-scm.org/D10955
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 03 Jul 2021 04:07:21 +0200
parents 769037a279ec
children 559aee84b889
line wrap: on
line diff
--- a/mercurial/cext/parsers.c	Sun Jul 04 03:29:20 2021 +0200
+++ b/mercurial/cext/parsers.c	Sat Jul 03 04:07:21 2021 +0200
@@ -155,8 +155,18 @@
 	return PyBytes_FromStringAndSize(&self->state, 1);
 };
 
+static PyObject *dirstatetuple_get_merged(dirstateTupleObject *self)
+{
+	if (self->state == 'm') {
+		Py_RETURN_TRUE;
+	} else {
+		Py_RETURN_FALSE;
+	}
+};
+
 static PyGetSetDef dirstatetuple_getset[] = {
     {"state", (getter)dirstatetuple_get_state, NULL, "state", NULL},
+    {"merged", (getter)dirstatetuple_get_merged, NULL, "merged", NULL},
     {NULL} /* Sentinel */
 };