345 return NULL; |
345 return NULL; |
346 } |
346 } |
347 return (PyObject *)dirstate_item_from_v1_data(state, mode, size, mtime); |
347 return (PyObject *)dirstate_item_from_v1_data(state, mode, size, mtime); |
348 }; |
348 }; |
349 |
349 |
350 /* constructor to help legacy API to build a new "from_p2" item |
|
351 |
|
352 Should eventually be removed */ |
|
353 static PyObject *dirstate_item_new_from_p2(PyTypeObject *subtype) |
|
354 { |
|
355 /* We do all the initialization here and not a tp_init function because |
|
356 * dirstate_item is immutable. */ |
|
357 dirstateItemObject *t; |
|
358 t = (dirstateItemObject *)subtype->tp_alloc(subtype, 1); |
|
359 if (!t) { |
|
360 return NULL; |
|
361 } |
|
362 t->flags = dirstate_flag_wc_tracked | dirstate_flag_p2_info; |
|
363 t->mode = 0; |
|
364 t->size = 0; |
|
365 t->mtime = 0; |
|
366 return (PyObject *)t; |
|
367 }; |
|
368 |
|
369 /* constructor to help legacy API to build a new "possibly" item |
350 /* constructor to help legacy API to build a new "possibly" item |
370 |
351 |
371 Should eventually be removed */ |
352 Should eventually be removed */ |
372 static PyObject *dirstate_item_new_possibly_dirty(PyTypeObject *subtype) |
353 static PyObject *dirstate_item_new_possibly_dirty(PyTypeObject *subtype) |
373 { |
354 { |
473 "return a \"mtime\" suitable for v1 serialization"}, |
454 "return a \"mtime\" suitable for v1 serialization"}, |
474 {"need_delay", (PyCFunction)dirstate_item_need_delay, METH_O, |
455 {"need_delay", (PyCFunction)dirstate_item_need_delay, METH_O, |
475 "True if the stored mtime would be ambiguous with the current time"}, |
456 "True if the stored mtime would be ambiguous with the current time"}, |
476 {"from_v1_data", (PyCFunction)dirstate_item_from_v1_meth, |
457 {"from_v1_data", (PyCFunction)dirstate_item_from_v1_meth, |
477 METH_VARARGS | METH_CLASS, "build a new DirstateItem object from V1 data"}, |
458 METH_VARARGS | METH_CLASS, "build a new DirstateItem object from V1 data"}, |
478 {"new_from_p2", (PyCFunction)dirstate_item_new_from_p2, |
|
479 METH_NOARGS | METH_CLASS, |
|
480 "constructor to help legacy API to build a new \"from_p2\" item"}, |
|
481 {"new_possibly_dirty", (PyCFunction)dirstate_item_new_possibly_dirty, |
459 {"new_possibly_dirty", (PyCFunction)dirstate_item_new_possibly_dirty, |
482 METH_NOARGS | METH_CLASS, |
460 METH_NOARGS | METH_CLASS, |
483 "constructor to help legacy API to build a new \"possibly_dirty\" item"}, |
461 "constructor to help legacy API to build a new \"possibly_dirty\" item"}, |
484 {"new_normal", (PyCFunction)dirstate_item_new_normal, |
462 {"new_normal", (PyCFunction)dirstate_item_new_normal, |
485 METH_VARARGS | METH_CLASS, |
463 METH_VARARGS | METH_CLASS, |