Show More
@@ -174,14 +174,6 b' static inline bool dirstate_item_c_from_' | |||||
174 | return (self->flags & dirstate_flag_clean_p2); |
|
174 | return (self->flags & dirstate_flag_clean_p2); | |
175 | } |
|
175 | } | |
176 |
|
176 | |||
177 | static inline bool dirstate_item_c_from_p2_removed(dirstateItemObject *self) |
|
|||
178 | { |
|
|||
179 | if (!dirstate_item_c_removed(self)) { |
|
|||
180 | return false; |
|
|||
181 | } |
|
|||
182 | return (self->flags & dirstate_flag_clean_p2); |
|
|||
183 | } |
|
|||
184 |
|
||||
185 | static inline char dirstate_item_c_v1_state(dirstateItemObject *self) |
|
177 | static inline char dirstate_item_c_v1_state(dirstateItemObject *self) | |
186 | { |
|
178 | { | |
187 | if (dirstate_item_c_removed(self)) { |
|
179 | if (dirstate_item_c_removed(self)) { | |
@@ -628,15 +620,6 b' static PyObject *dirstate_item_get_from_' | |||||
628 | } |
|
620 | } | |
629 | }; |
|
621 | }; | |
630 |
|
622 | |||
631 | static PyObject *dirstate_item_get_from_p2_removed(dirstateItemObject *self) |
|
|||
632 | { |
|
|||
633 | if (dirstate_item_c_from_p2_removed(self)) { |
|
|||
634 | Py_RETURN_TRUE; |
|
|||
635 | } else { |
|
|||
636 | Py_RETURN_FALSE; |
|
|||
637 | } |
|
|||
638 | }; |
|
|||
639 |
|
||||
640 | static PyObject *dirstate_item_get_removed(dirstateItemObject *self) |
|
623 | static PyObject *dirstate_item_get_removed(dirstateItemObject *self) | |
641 | { |
|
624 | { | |
642 | if (dirstate_item_c_removed(self)) { |
|
625 | if (dirstate_item_c_removed(self)) { | |
@@ -654,8 +637,6 b' static PyGetSetDef dirstate_item_getset[' | |||||
654 | {"tracked", (getter)dirstate_item_get_tracked, NULL, "tracked", NULL}, |
|
637 | {"tracked", (getter)dirstate_item_get_tracked, NULL, "tracked", NULL}, | |
655 | {"added", (getter)dirstate_item_get_added, NULL, "added", NULL}, |
|
638 | {"added", (getter)dirstate_item_get_added, NULL, "added", NULL}, | |
656 | {"merged", (getter)dirstate_item_get_merged, NULL, "merged", NULL}, |
|
639 | {"merged", (getter)dirstate_item_get_merged, NULL, "merged", NULL}, | |
657 | {"from_p2_removed", (getter)dirstate_item_get_from_p2_removed, NULL, |
|
|||
658 | "from_p2_removed", NULL}, |
|
|||
659 | {"from_p2", (getter)dirstate_item_get_from_p2, NULL, "from_p2", NULL}, |
|
640 | {"from_p2", (getter)dirstate_item_get_from_p2, NULL, "from_p2", NULL}, | |
660 | {"removed", (getter)dirstate_item_get_removed, NULL, "removed", NULL}, |
|
641 | {"removed", (getter)dirstate_item_get_removed, NULL, "removed", NULL}, | |
661 | {NULL} /* Sentinel */ |
|
642 | {NULL} /* Sentinel */ |
@@ -339,15 +339,6 b' class DirstateItem(object):' | |||||
339 | return self._clean_p2 |
|
339 | return self._clean_p2 | |
340 |
|
340 | |||
341 | @property |
|
341 | @property | |
342 | def from_p2_removed(self): |
|
|||
343 | """True if the file has been removed, but was "from_p2" initially |
|
|||
344 |
|
||||
345 | This property seems like an abstraction leakage and should probably be |
|
|||
346 | dealt in this class (or maybe the dirstatemap) directly. |
|
|||
347 | """ |
|
|||
348 | return self.removed and self._clean_p2 |
|
|||
349 |
|
||||
350 | @property |
|
|||
351 | def removed(self): |
|
342 | def removed(self): | |
352 | """True if the file has been removed""" |
|
343 | """True if the file has been removed""" | |
353 | return not self._wc_tracked and (self._p1_tracked or self._p2_tracked) |
|
344 | return not self._wc_tracked and (self._p1_tracked or self._p2_tracked) |
@@ -178,10 +178,6 b' impl DirstateEntry {' | |||||
178 | && !self.flags.contains(Flags::WDIR_TRACKED) |
|
178 | && !self.flags.contains(Flags::WDIR_TRACKED) | |
179 | } |
|
179 | } | |
180 |
|
180 | |||
181 | pub fn from_p2_removed(&self) -> bool { |
|
|||
182 | self.removed() && self.flags.contains(Flags::CLEAN_P2) |
|
|||
183 | } |
|
|||
184 |
|
||||
185 | pub fn merged(&self) -> bool { |
|
181 | pub fn merged(&self) -> bool { | |
186 | self.flags.contains(Flags::WDIR_TRACKED | Flags::MERGED) |
|
182 | self.flags.contains(Flags::WDIR_TRACKED | Flags::MERGED) | |
187 | } |
|
183 | } |
@@ -85,11 +85,6 b' py_class!(pub class DirstateItem |py| {' | |||||
85 | Ok(self.entry(py).get().from_p2()) |
|
85 | Ok(self.entry(py).get().from_p2()) | |
86 | } |
|
86 | } | |
87 |
|
87 | |||
88 | @property |
|
|||
89 | def from_p2_removed(&self) -> PyResult<bool> { |
|
|||
90 | Ok(self.entry(py).get().from_p2_removed()) |
|
|||
91 | } |
|
|||
92 |
|
||||
93 | def v1_state(&self) -> PyResult<PyBytes> { |
|
88 | def v1_state(&self) -> PyResult<PyBytes> { | |
94 | let (state, _mode, _size, _mtime) = self.entry(py).get().v1_data(); |
|
89 | let (state, _mode, _size, _mtime) = self.entry(py).get().v1_data(); | |
95 | let state_byte: u8 = state.into(); |
|
90 | let state_byte: u8 = state.into(); |
General Comments 0
You need to be logged in to leave comments.
Login now