Changeset View
Changeset View
Standalone View
Standalone View
mercurial/cext/parsers.c
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Line(s) | |||||
/* This means the next status call will have to actually check its content | /* This means the next status call will have to actually check its content | ||||
to make sure it is correct. */ | to make sure it is correct. */ | ||||
static PyObject *dirstate_item_set_possibly_dirty(dirstateItemObject *self) | static PyObject *dirstate_item_set_possibly_dirty(dirstateItemObject *self) | ||||
{ | { | ||||
self->mtime = ambiguous_time; | self->mtime = ambiguous_time; | ||||
Py_RETURN_NONE; | Py_RETURN_NONE; | ||||
} | } | ||||
static PyObject *dirstate_item_set_untracked(dirstateItemObject *self) | |||||
{ | |||||
if (self->state == 'm') { | |||||
self->size = dirstate_v1_nonnormal; | |||||
} else if (self->state == 'n' && self->size == dirstate_v1_from_p2) { | |||||
self->size = dirstate_v1_from_p2; | |||||
} else { | |||||
self->size = 0; | |||||
} | |||||
self->state = 'r'; | |||||
self->mode = 0; | |||||
self->mtime = 0; | |||||
Py_RETURN_NONE; | |||||
} | |||||
static PyMethodDef dirstate_item_methods[] = { | static PyMethodDef dirstate_item_methods[] = { | ||||
{"v1_state", (PyCFunction)dirstate_item_v1_state, METH_NOARGS, | {"v1_state", (PyCFunction)dirstate_item_v1_state, METH_NOARGS, | ||||
"return a \"state\" suitable for v1 serialization"}, | "return a \"state\" suitable for v1 serialization"}, | ||||
{"v1_mode", (PyCFunction)dirstate_item_v1_mode, METH_NOARGS, | {"v1_mode", (PyCFunction)dirstate_item_v1_mode, METH_NOARGS, | ||||
"return a \"mode\" suitable for v1 serialization"}, | "return a \"mode\" suitable for v1 serialization"}, | ||||
{"v1_size", (PyCFunction)dirstate_item_v1_size, METH_NOARGS, | {"v1_size", (PyCFunction)dirstate_item_v1_size, METH_NOARGS, | ||||
"return a \"size\" suitable for v1 serialization"}, | "return a \"size\" suitable for v1 serialization"}, | ||||
{"v1_mtime", (PyCFunction)dirstate_item_v1_mtime, METH_NOARGS, | {"v1_mtime", (PyCFunction)dirstate_item_v1_mtime, METH_NOARGS, | ||||
"return a \"mtime\" suitable for v1 serialization"}, | "return a \"mtime\" suitable for v1 serialization"}, | ||||
{"need_delay", (PyCFunction)dirstate_item_need_delay, METH_O, | {"need_delay", (PyCFunction)dirstate_item_need_delay, METH_O, | ||||
"True if the stored mtime would be ambiguous with the current time"}, | "True if the stored mtime would be ambiguous with the current time"}, | ||||
{"from_v1_data", (PyCFunction)dirstate_item_from_v1_meth, METH_O, | {"from_v1_data", (PyCFunction)dirstate_item_from_v1_meth, METH_O, | ||||
"build a new DirstateItem object from V1 data"}, | "build a new DirstateItem object from V1 data"}, | ||||
{"set_possibly_dirty", (PyCFunction)dirstate_item_set_possibly_dirty, | {"set_possibly_dirty", (PyCFunction)dirstate_item_set_possibly_dirty, | ||||
METH_NOARGS, "mark a file as \"possibly dirty\""}, | METH_NOARGS, "mark a file as \"possibly dirty\""}, | ||||
{"set_untracked", (PyCFunction)dirstate_item_set_untracked, METH_NOARGS, | |||||
"mark a file as \"untracked\""}, | |||||
{"dm_nonnormal", (PyCFunction)dm_nonnormal, METH_NOARGS, | {"dm_nonnormal", (PyCFunction)dm_nonnormal, METH_NOARGS, | ||||
"True is the entry is non-normal in the dirstatemap sense"}, | "True is the entry is non-normal in the dirstatemap sense"}, | ||||
{"dm_otherparent", (PyCFunction)dm_otherparent, METH_NOARGS, | {"dm_otherparent", (PyCFunction)dm_otherparent, METH_NOARGS, | ||||
"True is the entry is `otherparent` in the dirstatemap sense"}, | "True is the entry is `otherparent` in the dirstatemap sense"}, | ||||
{NULL} /* Sentinel */ | {NULL} /* Sentinel */ | ||||
}; | }; | ||||
static PyObject *dirstate_item_get_mode(dirstateItemObject *self) | static PyObject *dirstate_item_get_mode(dirstateItemObject *self) | ||||
▲ Show 20 Lines • Show All 741 Lines • Show Last 20 Lines |