513 self->mtime = 0; |
513 self->mtime = 0; |
514 self->size = 0; |
514 self->size = 0; |
515 Py_RETURN_NONE; |
515 Py_RETURN_NONE; |
516 } |
516 } |
517 |
517 |
|
518 static PyObject *dirstate_item_drop_merge_data(dirstateItemObject *self) |
|
519 { |
|
520 if (dirstate_item_c_merged(self) || dirstate_item_c_from_p2(self)) { |
|
521 if (dirstate_item_c_merged(self)) { |
|
522 self->flags |= dirstate_flag_p1_tracked; |
|
523 } else { |
|
524 self->flags &= ~dirstate_flag_p1_tracked; |
|
525 } |
|
526 self->flags &= |
|
527 ~(dirstate_flag_merged | dirstate_flag_clean_p1 | |
|
528 dirstate_flag_clean_p2 | dirstate_flag_p2_tracked); |
|
529 self->flags |= dirstate_flag_possibly_dirty; |
|
530 self->mode = 0; |
|
531 self->mtime = 0; |
|
532 /* size = None on the python size turn into size = NON_NORMAL |
|
533 * when accessed. So the next line is currently required, but a |
|
534 * some future clean up would be welcome. */ |
|
535 self->size = dirstate_v1_nonnormal; |
|
536 } |
|
537 Py_RETURN_NONE; |
|
538 } |
518 static PyMethodDef dirstate_item_methods[] = { |
539 static PyMethodDef dirstate_item_methods[] = { |
519 {"v1_state", (PyCFunction)dirstate_item_v1_state, METH_NOARGS, |
540 {"v1_state", (PyCFunction)dirstate_item_v1_state, METH_NOARGS, |
520 "return a \"state\" suitable for v1 serialization"}, |
541 "return a \"state\" suitable for v1 serialization"}, |
521 {"v1_mode", (PyCFunction)dirstate_item_v1_mode, METH_NOARGS, |
542 {"v1_mode", (PyCFunction)dirstate_item_v1_mode, METH_NOARGS, |
522 "return a \"mode\" suitable for v1 serialization"}, |
543 "return a \"mode\" suitable for v1 serialization"}, |
549 "mark a file as \"clean\""}, |
570 "mark a file as \"clean\""}, |
550 {"set_tracked", (PyCFunction)dirstate_item_set_tracked, METH_NOARGS, |
571 {"set_tracked", (PyCFunction)dirstate_item_set_tracked, METH_NOARGS, |
551 "mark a file as \"tracked\""}, |
572 "mark a file as \"tracked\""}, |
552 {"set_untracked", (PyCFunction)dirstate_item_set_untracked, METH_NOARGS, |
573 {"set_untracked", (PyCFunction)dirstate_item_set_untracked, METH_NOARGS, |
553 "mark a file as \"untracked\""}, |
574 "mark a file as \"untracked\""}, |
|
575 {"drop_merge_data", (PyCFunction)dirstate_item_drop_merge_data, METH_NOARGS, |
|
576 "remove all \"merge-only\" from a DirstateItem"}, |
554 {NULL} /* Sentinel */ |
577 {NULL} /* Sentinel */ |
555 }; |
578 }; |
556 |
579 |
557 static PyObject *dirstate_item_get_mode(dirstateItemObject *self) |
580 static PyObject *dirstate_item_get_mode(dirstateItemObject *self) |
558 { |
581 { |