##// END OF EJS Templates
pack_dirstate: in C version, for invalidation set dict to what we write to disk...
Siddharth Agarwal -
r21806:05bd2667 default
parent child Browse files
Show More
@@ -261,7 +261,7 b' static PyObject *dirstate_unset;'
261 static PyObject *pack_dirstate(PyObject *self, PyObject *args)
261 static PyObject *pack_dirstate(PyObject *self, PyObject *args)
262 {
262 {
263 PyObject *packobj = NULL;
263 PyObject *packobj = NULL;
264 PyObject *map, *copymap, *pl;
264 PyObject *map, *copymap, *pl, *mtime_unset = NULL;
265 Py_ssize_t nbytes, pos, l;
265 Py_ssize_t nbytes, pos, l;
266 PyObject *k, *v, *pn;
266 PyObject *k, *v, *pn;
267 char *p, *s;
267 char *p, *s;
@@ -342,9 +342,15 b' static PyObject *pack_dirstate(PyObject '
342 if (*s == 'n' && mtime == (uint32_t)now) {
342 if (*s == 'n' && mtime == (uint32_t)now) {
343 /* See pure/parsers.py:pack_dirstate for why we do
343 /* See pure/parsers.py:pack_dirstate for why we do
344 * this. */
344 * this. */
345 if (PyDict_SetItem(map, k, dirstate_unset) == -1)
345 mtime = -1;
346 mtime_unset = Py_BuildValue(
347 "ciii", *s, mode, size, mtime);
348 if (!mtime_unset)
346 goto bail;
349 goto bail;
347 mtime = -1;
350 if (PyDict_SetItem(map, k, mtime_unset) == -1)
351 goto bail;
352 Py_DECREF(mtime_unset);
353 mtime_unset = NULL;
348 }
354 }
349 putbe32(mode, p);
355 putbe32(mode, p);
350 putbe32(size, p + 4);
356 putbe32(size, p + 4);
@@ -374,6 +380,7 b' static PyObject *pack_dirstate(PyObject '
374
380
375 return packobj;
381 return packobj;
376 bail:
382 bail:
383 Py_XDECREF(mtime_unset);
377 Py_XDECREF(packobj);
384 Py_XDECREF(packobj);
378 return NULL;
385 return NULL;
379 }
386 }
General Comments 0
You need to be logged in to leave comments. Login now