##// END OF EJS Templates
dirstate-item: factor some code in the C implementation...
marmoute -
r48758:0919d66e default
parent child Browse files
Show More
@@ -209,23 +209,12 b' static PyObject *dirstate_item_from_v1_m'
209 {
209 {
210 /* We do all the initialization here and not a tp_init function because
210 /* We do all the initialization here and not a tp_init function because
211 * dirstate_item is immutable. */
211 * dirstate_item is immutable. */
212 dirstateItemObject *t;
213 char state;
212 char state;
214 int size, mode, mtime;
213 int size, mode, mtime;
215 if (!PyArg_ParseTuple(args, "ciii", &state, &mode, &size, &mtime)) {
214 if (!PyArg_ParseTuple(args, "ciii", &state, &mode, &size, &mtime)) {
216 return NULL;
215 return NULL;
217 }
216 }
218
217 return (PyObject *)dirstate_item_from_v1_data(state, mode, size, mtime);
219 t = (dirstateItemObject *)subtype->tp_alloc(subtype, 1);
220 if (!t) {
221 return NULL;
222 }
223 t->state = state;
224 t->mode = mode;
225 t->size = size;
226 t->mtime = mtime;
227
228 return (PyObject *)t;
229 };
218 };
230
219
231 /* constructor to help legacy API to build a new "added" item
220 /* constructor to help legacy API to build a new "added" item
General Comments 0
You need to be logged in to leave comments. Login now