Show More
@@ -158,6 +158,15 b' static PyObject *dirstatetuple_get_state' | |||||
158 | return PyBytes_FromStringAndSize(&self->state, 1); |
|
158 | return PyBytes_FromStringAndSize(&self->state, 1); | |
159 | }; |
|
159 | }; | |
160 |
|
160 | |||
|
161 | static PyObject *dirstatetuple_get_added(dirstateTupleObject *self) | |||
|
162 | { | |||
|
163 | if (self->state == 'a') { | |||
|
164 | Py_RETURN_TRUE; | |||
|
165 | } else { | |||
|
166 | Py_RETURN_FALSE; | |||
|
167 | } | |||
|
168 | }; | |||
|
169 | ||||
161 | static PyObject *dirstatetuple_get_merged(dirstateTupleObject *self) |
|
170 | static PyObject *dirstatetuple_get_merged(dirstateTupleObject *self) | |
162 | { |
|
171 | { | |
163 | if (self->state == 'm') { |
|
172 | if (self->state == 'm') { | |
@@ -205,6 +214,7 b' static PyObject *dirstatetuple_get_remov' | |||||
205 |
|
214 | |||
206 | static PyGetSetDef dirstatetuple_getset[] = { |
|
215 | static PyGetSetDef dirstatetuple_getset[] = { | |
207 | {"state", (getter)dirstatetuple_get_state, NULL, "state", NULL}, |
|
216 | {"state", (getter)dirstatetuple_get_state, NULL, "state", NULL}, | |
|
217 | {"added", (getter)dirstatetuple_get_added, NULL, "added", NULL}, | |||
208 | {"merged_removed", (getter)dirstatetuple_get_merged_removed, NULL, |
|
218 | {"merged_removed", (getter)dirstatetuple_get_merged_removed, NULL, | |
209 | "merged_removed", NULL}, |
|
219 | "merged_removed", NULL}, | |
210 | {"merged", (getter)dirstatetuple_get_merged, NULL, "merged", NULL}, |
|
220 | {"merged", (getter)dirstatetuple_get_merged, NULL, "merged", NULL}, |
@@ -1346,7 +1346,7 b' class dirstate(object):' | |||||
1346 | cadd(fn) |
|
1346 | cadd(fn) | |
1347 | elif t.merged: |
|
1347 | elif t.merged: | |
1348 | madd(fn) |
|
1348 | madd(fn) | |
1349 |
elif |
|
1349 | elif t.added: | |
1350 | aadd(fn) |
|
1350 | aadd(fn) | |
1351 | elif t.removed: |
|
1351 | elif t.removed: | |
1352 | radd(fn) |
|
1352 | radd(fn) |
@@ -87,6 +87,11 b' class dirstatetuple(object):' | |||||
87 | return self._state |
|
87 | return self._state | |
88 |
|
88 | |||
89 | @property |
|
89 | @property | |
|
90 | def added(self): | |||
|
91 | """True if the file has been added""" | |||
|
92 | return self._state == b'a' | |||
|
93 | ||||
|
94 | @property | |||
90 | def merged(self): |
|
95 | def merged(self): | |
91 | """True if the file has been merged |
|
96 | """True if the file has been merged | |
92 |
|
97 |
General Comments 0
You need to be logged in to leave comments.
Login now