##// END OF EJS Templates
dirstate-item: introduce a `p2_info` property that combine two others...
marmoute -
r48954:fb3b41d5 default
parent child Browse files
Show More
@@ -577,6 +577,16 b' static PyObject *dirstate_item_get_added'
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 590 static PyObject *dirstate_item_get_merged(dirstateItemObject *self)
581 591 {
582 592 if (dirstate_item_c_merged(self)) {
@@ -633,6 +643,7 b' static PyGetSetDef dirstate_item_getset['
633 643 {"state", (getter)dirstate_item_get_state, NULL, "state", NULL},
634 644 {"tracked", (getter)dirstate_item_get_tracked, NULL, "tracked", NULL},
635 645 {"added", (getter)dirstate_item_get_added, NULL, "added", NULL},
646 {"p2_info", (getter)dirstate_item_get_p2_info, NULL, "p2_info", NULL},
636 647 {"merged", (getter)dirstate_item_get_merged, NULL, "merged", NULL},
637 648 {"from_p2", (getter)dirstate_item_get_from_p2, NULL, "from_p2", NULL},
638 649 {"maybe_clean", (getter)dirstate_item_get_maybe_clean, NULL, "maybe_clean",
@@ -301,6 +301,14 b' class DirstateItem(object):'
301 301 return True
302 302
303 303 @property
304 def p2_info(self):
305 """True if the file needed to merge or apply any input from p2
306
307 See the class documentation for details.
308 """
309 return self._wc_tracked and self._p2_info
310
311 @property
304 312 def merged(self):
305 313 """True if the file has been merged
306 314
@@ -161,6 +161,10 b' impl DirstateEntry {'
161 161 self.in_either_parent() && !self.flags.contains(Flags::WDIR_TRACKED)
162 162 }
163 163
164 pub fn p2_info(&self) -> bool {
165 self.flags.contains(Flags::WDIR_TRACKED | Flags::P2_INFO)
166 }
167
164 168 pub fn merged(&self) -> bool {
165 169 self.flags
166 170 .contains(Flags::WDIR_TRACKED | Flags::P1_TRACKED | Flags::P2_INFO)
@@ -71,6 +71,12 b' py_class!(pub class DirstateItem |py| {'
71 71 Ok(self.entry(py).get().added())
72 72 }
73 73
74
75 @property
76 def p2_info(&self) -> PyResult<bool> {
77 Ok(self.entry(py).get().p2_info())
78 }
79
74 80 @property
75 81 def merged(&self) -> PyResult<bool> {
76 82 Ok(self.entry(py).get().merged())
General Comments 0
You need to be logged in to leave comments. Login now