##// END OF EJS Templates
parsers: make pack_dirstate take now in integer for consistency...
FUJIWARA Katsunori -
r26630:3111b45a default
parent child Browse files
Show More
@@ -627,7 +627,7 b' class dirstate(object):'
627 def _writedirstate(self, st):
627 def _writedirstate(self, st):
628 # use the modification time of the newly created temporary file as the
628 # use the modification time of the newly created temporary file as the
629 # filesystem's notion of 'now'
629 # filesystem's notion of 'now'
630 now = util.fstat(st).st_mtime
630 now = util.statmtimesec(util.fstat(st)) & _rangemask
631 st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl, now))
631 st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl, now))
632 st.close()
632 st.close()
633 self._lastnormaltime = 0
633 self._lastnormaltime = 0
@@ -551,9 +551,9 b' static PyObject *pack_dirstate(PyObject '
551 Py_ssize_t nbytes, pos, l;
551 Py_ssize_t nbytes, pos, l;
552 PyObject *k, *v = NULL, *pn;
552 PyObject *k, *v = NULL, *pn;
553 char *p, *s;
553 char *p, *s;
554 double now;
554 int now;
555
555
556 if (!PyArg_ParseTuple(args, "O!O!Od:pack_dirstate",
556 if (!PyArg_ParseTuple(args, "O!O!Oi:pack_dirstate",
557 &PyDict_Type, &map, &PyDict_Type, &copymap,
557 &PyDict_Type, &map, &PyDict_Type, &copymap,
558 &pl, &now))
558 &pl, &now))
559 return NULL;
559 return NULL;
@@ -622,7 +622,7 b' static PyObject *pack_dirstate(PyObject '
622 mode = tuple->mode;
622 mode = tuple->mode;
623 size = tuple->size;
623 size = tuple->size;
624 mtime = tuple->mtime;
624 mtime = tuple->mtime;
625 if (state == 'n' && mtime == (uint32_t)now) {
625 if (state == 'n' && mtime == now) {
626 /* See pure/parsers.py:pack_dirstate for why we do
626 /* See pure/parsers.py:pack_dirstate for why we do
627 * this. */
627 * this. */
628 mtime = -1;
628 mtime = -1;
@@ -31,8 +31,7 b' def fakewrite(ui, func):'
31
31
32 # parsing 'fakenow' in YYYYmmddHHMM format makes comparison between
32 # parsing 'fakenow' in YYYYmmddHHMM format makes comparison between
33 # 'fakenow' value and 'touch -t YYYYmmddHHMM' argument easy
33 # 'fakenow' value and 'touch -t YYYYmmddHHMM' argument easy
34 timestamp = util.parsedate(fakenow, ['%Y%m%d%H%M'])[0]
34 fakenow = util.parsedate(fakenow, ['%Y%m%d%H%M'])[0]
35 fakenow = float(timestamp)
36
35
37 orig_pack_dirstate = parsers.pack_dirstate
36 orig_pack_dirstate = parsers.pack_dirstate
38 wrapper = lambda *args: pack_dirstate(fakenow, orig_pack_dirstate, *args)
37 wrapper = lambda *args: pack_dirstate(fakenow, orig_pack_dirstate, *args)
General Comments 0
You need to be logged in to leave comments. Login now