Mercurial > hg
diff mercurial/cext/parsers.c @ 47515:c94d3ff46fd5
dirstate-entry: add a `removed` property
Lets start to define and use more semantic property.
Differential Revision: https://phab.mercurial-scm.org/D10957
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 03 Jul 2021 04:18:54 +0200 |
parents | 559aee84b889 |
children | b8ffe85e399b |
line wrap: on
line diff
--- a/mercurial/cext/parsers.c Sat Jul 03 04:26:28 2021 +0200 +++ b/mercurial/cext/parsers.c Sat Jul 03 04:18:54 2021 +0200 @@ -175,10 +175,20 @@ } }; +static PyObject *dirstatetuple_get_removed(dirstateTupleObject *self) +{ + if (self->state == 'r') { + 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}, {"from_p2", (getter)dirstatetuple_get_from_p2, NULL, "from_p2", NULL}, + {"removed", (getter)dirstatetuple_get_removed, NULL, "removed", NULL}, {NULL} /* Sentinel */ };