Mercurial > public > mercurial-scm > hg
diff mercurial/cext/parsers.c @ 49820:3eac92509484
dirstate-entry: add `modified` property
This was already done in the Rust implementation and is a useful primitive.
The C implementation had this called `merged`, but wasn't used anywhere.
It will be used in the next changeset.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Mon, 02 May 2022 11:40:33 +0200 |
parents | 34020d1f1635 |
children | 3149dc824a94 |
line wrap: on
line diff
--- a/mercurial/cext/parsers.c Mon Dec 19 16:22:01 2022 +0100 +++ b/mercurial/cext/parsers.c Mon May 02 11:40:33 2022 +0200 @@ -177,7 +177,7 @@ (dirstate_flag_p1_tracked | dirstate_flag_p2_info)); } -static inline bool dirstate_item_c_merged(dirstateItemObject *self) +static inline bool dirstate_item_c_modified(dirstateItemObject *self) { return ((self->flags & dirstate_flag_wc_tracked) && (self->flags & dirstate_flag_p1_tracked) && @@ -195,7 +195,7 @@ { if (dirstate_item_c_removed(self)) { return 'r'; - } else if (dirstate_item_c_merged(self)) { + } else if (dirstate_item_c_modified(self)) { return 'm'; } else if (dirstate_item_c_added(self)) { return 'a'; @@ -642,9 +642,9 @@ } }; -static PyObject *dirstate_item_get_merged(dirstateItemObject *self) +static PyObject *dirstate_item_get_modified(dirstateItemObject *self) { - if (dirstate_item_c_merged(self)) { + if (dirstate_item_c_modified(self)) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; @@ -709,7 +709,7 @@ 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}, + {"modified", (getter)dirstate_item_get_modified, NULL, "modified", NULL}, {"from_p2", (getter)dirstate_item_get_from_p2, NULL, "from_p2", NULL}, {"maybe_clean", (getter)dirstate_item_get_maybe_clean, NULL, "maybe_clean", NULL}, @@ -1187,7 +1187,7 @@ void manifest_module_init(PyObject *mod); void revlog_module_init(PyObject *mod); -static const int version = 20; +static const int version = 21; static void module_init(PyObject *mod) {