218 /* This means the next status call will have to actually check its content |
218 /* This means the next status call will have to actually check its content |
219 to make sure it is correct. */ |
219 to make sure it is correct. */ |
220 static PyObject *dirstate_item_set_possibly_dirty(dirstateItemObject *self) |
220 static PyObject *dirstate_item_set_possibly_dirty(dirstateItemObject *self) |
221 { |
221 { |
222 self->mtime = ambiguous_time; |
222 self->mtime = ambiguous_time; |
|
223 Py_RETURN_NONE; |
|
224 } |
|
225 |
|
226 static PyObject *dirstate_item_set_untracked(dirstateItemObject *self) |
|
227 { |
|
228 if (self->state == 'm') { |
|
229 self->size = dirstate_v1_nonnormal; |
|
230 } else if (self->state == 'n' && self->size == dirstate_v1_from_p2) { |
|
231 self->size = dirstate_v1_from_p2; |
|
232 } else { |
|
233 self->size = 0; |
|
234 } |
|
235 self->state = 'r'; |
|
236 self->mode = 0; |
|
237 self->mtime = 0; |
223 Py_RETURN_NONE; |
238 Py_RETURN_NONE; |
224 } |
239 } |
225 |
240 |
226 static PyMethodDef dirstate_item_methods[] = { |
241 static PyMethodDef dirstate_item_methods[] = { |
227 {"v1_state", (PyCFunction)dirstate_item_v1_state, METH_NOARGS, |
242 {"v1_state", (PyCFunction)dirstate_item_v1_state, METH_NOARGS, |
236 "True if the stored mtime would be ambiguous with the current time"}, |
251 "True if the stored mtime would be ambiguous with the current time"}, |
237 {"from_v1_data", (PyCFunction)dirstate_item_from_v1_meth, METH_O, |
252 {"from_v1_data", (PyCFunction)dirstate_item_from_v1_meth, METH_O, |
238 "build a new DirstateItem object from V1 data"}, |
253 "build a new DirstateItem object from V1 data"}, |
239 {"set_possibly_dirty", (PyCFunction)dirstate_item_set_possibly_dirty, |
254 {"set_possibly_dirty", (PyCFunction)dirstate_item_set_possibly_dirty, |
240 METH_NOARGS, "mark a file as \"possibly dirty\""}, |
255 METH_NOARGS, "mark a file as \"possibly dirty\""}, |
|
256 {"set_untracked", (PyCFunction)dirstate_item_set_untracked, METH_NOARGS, |
|
257 "mark a file as \"untracked\""}, |
241 {"dm_nonnormal", (PyCFunction)dm_nonnormal, METH_NOARGS, |
258 {"dm_nonnormal", (PyCFunction)dm_nonnormal, METH_NOARGS, |
242 "True is the entry is non-normal in the dirstatemap sense"}, |
259 "True is the entry is non-normal in the dirstatemap sense"}, |
243 {"dm_otherparent", (PyCFunction)dm_otherparent, METH_NOARGS, |
260 {"dm_otherparent", (PyCFunction)dm_otherparent, METH_NOARGS, |
244 "True is the entry is `otherparent` in the dirstatemap sense"}, |
261 "True is the entry is `otherparent` in the dirstatemap sense"}, |
245 {NULL} /* Sentinel */ |
262 {NULL} /* Sentinel */ |