##// END OF EJS Templates
dirstate-entry: add `modified` property...
Raphaël Gomès -
r50715:3eac9250 default
parent child Browse files
Show More
@@ -177,7 +177,7 b' static inline bool dirstate_item_c_remov'
177 177 (dirstate_flag_p1_tracked | dirstate_flag_p2_info));
178 178 }
179 179
180 static inline bool dirstate_item_c_merged(dirstateItemObject *self)
180 static inline bool dirstate_item_c_modified(dirstateItemObject *self)
181 181 {
182 182 return ((self->flags & dirstate_flag_wc_tracked) &&
183 183 (self->flags & dirstate_flag_p1_tracked) &&
@@ -195,7 +195,7 b' static inline char dirstate_item_c_v1_st'
195 195 {
196 196 if (dirstate_item_c_removed(self)) {
197 197 return 'r';
198 } else if (dirstate_item_c_merged(self)) {
198 } else if (dirstate_item_c_modified(self)) {
199 199 return 'm';
200 200 } else if (dirstate_item_c_added(self)) {
201 201 return 'a';
@@ -642,9 +642,9 b' static PyObject *dirstate_item_get_p2_in'
642 642 }
643 643 };
644 644
645 static PyObject *dirstate_item_get_merged(dirstateItemObject *self)
645 static PyObject *dirstate_item_get_modified(dirstateItemObject *self)
646 646 {
647 if (dirstate_item_c_merged(self)) {
647 if (dirstate_item_c_modified(self)) {
648 648 Py_RETURN_TRUE;
649 649 } else {
650 650 Py_RETURN_FALSE;
@@ -709,7 +709,7 b' static PyGetSetDef dirstate_item_getset['
709 709 NULL},
710 710 {"added", (getter)dirstate_item_get_added, NULL, "added", NULL},
711 711 {"p2_info", (getter)dirstate_item_get_p2_info, NULL, "p2_info", NULL},
712 {"merged", (getter)dirstate_item_get_merged, NULL, "merged", NULL},
712 {"modified", (getter)dirstate_item_get_modified, NULL, "modified", NULL},
713 713 {"from_p2", (getter)dirstate_item_get_from_p2, NULL, "from_p2", NULL},
714 714 {"maybe_clean", (getter)dirstate_item_get_maybe_clean, NULL, "maybe_clean",
715 715 NULL},
@@ -1187,7 +1187,7 b' void dirs_module_init(PyObject *mod);'
1187 1187 void manifest_module_init(PyObject *mod);
1188 1188 void revlog_module_init(PyObject *mod);
1189 1189
1190 static const int version = 20;
1190 static const int version = 21;
1191 1191
1192 1192 static void module_init(PyObject *mod)
1193 1193 {
@@ -76,7 +76,7 b' def _importfrom(pkgname, modname):'
76 76 ('cext', 'bdiff'): 3,
77 77 ('cext', 'mpatch'): 1,
78 78 ('cext', 'osutil'): 4,
79 ('cext', 'parsers'): 20,
79 ('cext', 'parsers'): 21,
80 80 }
81 81
82 82 # map import request to other package or module
@@ -435,6 +435,11 b' class DirstateItem:'
435 435 return self._wc_tracked and not (self._p1_tracked or self._p2_info)
436 436
437 437 @property
438 def modified(self):
439 """True if the file has been modified"""
440 return self._wc_tracked and self._p1_tracked and self._p2_info
441
442 @property
438 443 def maybe_clean(self):
439 444 """True if the file has a chance to be in the "clean" state"""
440 445 if not self._wc_tracked:
@@ -151,6 +151,10 b' py_class!(pub class DirstateItem |py| {'
151 151 Ok(self.entry(py).get().added())
152 152 }
153 153
154 @property
155 def modified(&self) -> PyResult<bool> {
156 Ok(self.entry(py).get().modified())
157 }
154 158
155 159 @property
156 160 def p2_info(&self) -> PyResult<bool> {
General Comments 0
You need to be logged in to leave comments. Login now