Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
48141:42ab0bcb6ded | 48142:fb3b41d583c2 |
---|---|
575 } else { | 575 } else { |
576 Py_RETURN_FALSE; | 576 Py_RETURN_FALSE; |
577 } | 577 } |
578 }; | 578 }; |
579 | 579 |
580 static PyObject *dirstate_item_get_p2_info(dirstateItemObject *self) | |
581 { | |
582 if (self->flags & dirstate_flag_wc_tracked && | |
583 self->flags & dirstate_flag_p2_info) { | |
584 Py_RETURN_TRUE; | |
585 } else { | |
586 Py_RETURN_FALSE; | |
587 } | |
588 }; | |
589 | |
580 static PyObject *dirstate_item_get_merged(dirstateItemObject *self) | 590 static PyObject *dirstate_item_get_merged(dirstateItemObject *self) |
581 { | 591 { |
582 if (dirstate_item_c_merged(self)) { | 592 if (dirstate_item_c_merged(self)) { |
583 Py_RETURN_TRUE; | 593 Py_RETURN_TRUE; |
584 } else { | 594 } else { |
631 {"size", (getter)dirstate_item_get_size, NULL, "size", NULL}, | 641 {"size", (getter)dirstate_item_get_size, NULL, "size", NULL}, |
632 {"mtime", (getter)dirstate_item_get_mtime, NULL, "mtime", NULL}, | 642 {"mtime", (getter)dirstate_item_get_mtime, NULL, "mtime", NULL}, |
633 {"state", (getter)dirstate_item_get_state, NULL, "state", NULL}, | 643 {"state", (getter)dirstate_item_get_state, NULL, "state", NULL}, |
634 {"tracked", (getter)dirstate_item_get_tracked, NULL, "tracked", NULL}, | 644 {"tracked", (getter)dirstate_item_get_tracked, NULL, "tracked", NULL}, |
635 {"added", (getter)dirstate_item_get_added, NULL, "added", NULL}, | 645 {"added", (getter)dirstate_item_get_added, NULL, "added", NULL}, |
646 {"p2_info", (getter)dirstate_item_get_p2_info, NULL, "p2_info", NULL}, | |
636 {"merged", (getter)dirstate_item_get_merged, NULL, "merged", NULL}, | 647 {"merged", (getter)dirstate_item_get_merged, NULL, "merged", NULL}, |
637 {"from_p2", (getter)dirstate_item_get_from_p2, NULL, "from_p2", NULL}, | 648 {"from_p2", (getter)dirstate_item_get_from_p2, NULL, "from_p2", NULL}, |
638 {"maybe_clean", (getter)dirstate_item_get_maybe_clean, NULL, "maybe_clean", | 649 {"maybe_clean", (getter)dirstate_item_get_maybe_clean, NULL, "maybe_clean", |
639 NULL}, | 650 NULL}, |
640 {"any_tracked", (getter)dirstate_item_get_any_tracked, NULL, "any_tracked", | 651 {"any_tracked", (getter)dirstate_item_get_any_tracked, NULL, "any_tracked", |