77 wc_tracked = 0; |
78 wc_tracked = 0; |
78 p1_tracked = 0; |
79 p1_tracked = 0; |
79 p2_info = 0; |
80 p2_info = 0; |
80 has_meaningful_mtime = 1; |
81 has_meaningful_mtime = 1; |
81 has_meaningful_data = 1; |
82 has_meaningful_data = 1; |
|
83 mtime_second_ambiguous = 0; |
82 parentfiledata = Py_None; |
84 parentfiledata = Py_None; |
83 fallback_exec = Py_None; |
85 fallback_exec = Py_None; |
84 fallback_symlink = Py_None; |
86 fallback_symlink = Py_None; |
85 if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iiiiiOOO", keywords_name, |
87 if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iiiiiOOO", keywords_name, |
86 &wc_tracked, &p1_tracked, &p2_info, |
88 &wc_tracked, &p1_tracked, &p2_info, |
122 if (!PyArg_ParseTuple(parentfiledata, "iiO", &mode, &size, |
124 if (!PyArg_ParseTuple(parentfiledata, "iiO", &mode, &size, |
123 &mtime)) { |
125 &mtime)) { |
124 return NULL; |
126 return NULL; |
125 } |
127 } |
126 if (mtime != Py_None) { |
128 if (mtime != Py_None) { |
127 if (!PyArg_ParseTuple(mtime, "ii", &mtime_s, |
129 if (!PyArg_ParseTuple(mtime, "iii", &mtime_s, &mtime_ns, |
128 &mtime_ns)) { |
130 &mtime_second_ambiguous)) { |
129 return NULL; |
131 return NULL; |
130 } |
132 } |
131 } else { |
133 } else { |
132 has_meaningful_mtime = 0; |
134 has_meaningful_mtime = 0; |
133 } |
135 } |
323 static PyObject *dirstate_item_mtime_likely_equal_to(dirstateItemObject *self, |
328 static PyObject *dirstate_item_mtime_likely_equal_to(dirstateItemObject *self, |
324 PyObject *other) |
329 PyObject *other) |
325 { |
330 { |
326 int other_s; |
331 int other_s; |
327 int other_ns; |
332 int other_ns; |
328 if (!PyArg_ParseTuple(other, "ii", &other_s, &other_ns)) { |
333 int other_second_ambiguous; |
|
334 if (!PyArg_ParseTuple(other, "iii", &other_s, &other_ns, |
|
335 &other_second_ambiguous)) { |
329 return NULL; |
336 return NULL; |
330 } |
337 } |
331 if ((self->flags & dirstate_flag_has_mtime) && |
338 if ((self->flags & dirstate_flag_has_mtime) && |
332 self->mtime_s == other_s && |
339 self->mtime_s == other_s && |
333 (self->mtime_ns == other_ns || self->mtime_ns == 0 || |
340 (self->mtime_ns == other_ns || self->mtime_ns == 0 || |
466 |
473 |
467 /* See docstring of the python implementation for details */ |
474 /* See docstring of the python implementation for details */ |
468 static PyObject *dirstate_item_set_clean(dirstateItemObject *self, |
475 static PyObject *dirstate_item_set_clean(dirstateItemObject *self, |
469 PyObject *args) |
476 PyObject *args) |
470 { |
477 { |
471 int size, mode, mtime_s, mtime_ns; |
478 int size, mode, mtime_s, mtime_ns, mtime_second_ambiguous; |
472 PyObject *mtime; |
479 PyObject *mtime; |
473 mtime_s = 0; |
480 mtime_s = 0; |
474 mtime_ns = 0; |
481 mtime_ns = 0; |
|
482 mtime_second_ambiguous = 0; |
475 if (!PyArg_ParseTuple(args, "iiO", &mode, &size, &mtime)) { |
483 if (!PyArg_ParseTuple(args, "iiO", &mode, &size, &mtime)) { |
476 return NULL; |
484 return NULL; |
477 } |
485 } |
478 if (mtime != Py_None) { |
486 if (mtime != Py_None) { |
479 if (!PyArg_ParseTuple(mtime, "ii", &mtime_s, &mtime_ns)) { |
487 if (!PyArg_ParseTuple(mtime, "iii", &mtime_s, &mtime_ns, |
|
488 &mtime_second_ambiguous)) { |
480 return NULL; |
489 return NULL; |
481 } |
490 } |
482 } else { |
491 } else { |
483 self->flags &= ~dirstate_flag_has_mtime; |
492 self->flags &= ~dirstate_flag_has_mtime; |
484 } |
493 } |
485 self->flags = dirstate_flag_wc_tracked | dirstate_flag_p1_tracked | |
494 self->flags = dirstate_flag_wc_tracked | dirstate_flag_p1_tracked | |
486 dirstate_flag_has_meaningful_data | |
495 dirstate_flag_has_meaningful_data | |
487 dirstate_flag_has_mtime; |
496 dirstate_flag_has_mtime; |
|
497 if (mtime_second_ambiguous) { |
|
498 self->flags |= dirstate_flag_mtime_second_ambiguous; |
|
499 } |
488 self->mode = mode; |
500 self->mode = mode; |
489 self->size = size; |
501 self->size = size; |
490 self->mtime_s = mtime_s; |
502 self->mtime_s = mtime_s; |
491 self->mtime_ns = mtime_ns; |
503 self->mtime_ns = mtime_ns; |
492 Py_RETURN_NONE; |
504 Py_RETURN_NONE; |