Mercurial > hg
diff mercurial/cext/parsers.c @ 48142:fb3b41d583c2
dirstate-item: introduce a `p2_info` property that combine two others
The `merged` and `from_p2` property are always used together so we can expose a
combined property instead.
Differential Revision: https://phab.mercurial-scm.org/D11585
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 01 Oct 2021 04:04:09 +0200 |
parents | 38488d488ec1 |
children | 21542d4cb568 |
line wrap: on
line diff
--- a/mercurial/cext/parsers.c Fri Oct 01 02:01:12 2021 +0200 +++ b/mercurial/cext/parsers.c Fri Oct 01 04:04:09 2021 +0200 @@ -577,6 +577,16 @@ } }; +static PyObject *dirstate_item_get_p2_info(dirstateItemObject *self) +{ + if (self->flags & dirstate_flag_wc_tracked && + self->flags & dirstate_flag_p2_info) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } +}; + static PyObject *dirstate_item_get_merged(dirstateItemObject *self) { if (dirstate_item_c_merged(self)) { @@ -633,6 +643,7 @@ {"state", (getter)dirstate_item_get_state, NULL, "state", NULL}, {"tracked", (getter)dirstate_item_get_tracked, NULL, "tracked", NULL}, {"added", (getter)dirstate_item_get_added, NULL, "added", NULL}, + {"p2_info", (getter)dirstate_item_get_p2_info, NULL, "p2_info", NULL}, {"merged", (getter)dirstate_item_get_merged, NULL, "merged", NULL}, {"from_p2", (getter)dirstate_item_get_from_p2, NULL, "from_p2", NULL}, {"maybe_clean", (getter)dirstate_item_get_maybe_clean, NULL, "maybe_clean",