comparison mercurial/dirstate.py @ 26492:3a0bb61371c5

util: extract stub function to get mtime with second accuracy This function is trivial but will need a long comment why it can't use st.st_mtime. See the next patch for details.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 04 Oct 2015 22:25:29 +0900
parents 1ffc61c4e32e
children 3f41e28a16d8
comparison
equal deleted inserted replaced
26491:366d489295ca 26492:3a0bb61371c5
426 self._map[f] = dirstatetuple(state, mode, size, mtime) 426 self._map[f] = dirstatetuple(state, mode, size, mtime)
427 427
428 def normal(self, f): 428 def normal(self, f):
429 '''Mark a file normal and clean.''' 429 '''Mark a file normal and clean.'''
430 s = os.lstat(self._join(f)) 430 s = os.lstat(self._join(f))
431 mtime = int(s.st_mtime) 431 mtime = util.statmtimesec(s)
432 self._addpath(f, 'n', s.st_mode, 432 self._addpath(f, 'n', s.st_mode,
433 s.st_size & _rangemask, mtime & _rangemask) 433 s.st_size & _rangemask, mtime & _rangemask)
434 if f in self._copymap: 434 if f in self._copymap:
435 del self._copymap[f] 435 del self._copymap[f]
436 if mtime > self._lastnormaltime: 436 if mtime > self._lastnormaltime:
996 time = t[3] 996 time = t[3]
997 997
998 if not st and state in "nma": 998 if not st and state in "nma":
999 dadd(fn) 999 dadd(fn)
1000 elif state == 'n': 1000 elif state == 'n':
1001 mtime = int(st.st_mtime) 1001 mtime = util.statmtimesec(st)
1002 if (size >= 0 and 1002 if (size >= 0 and
1003 ((size != st.st_size and size != st.st_size & _rangemask) 1003 ((size != st.st_size and size != st.st_size & _rangemask)
1004 or ((mode ^ st.st_mode) & 0o100 and checkexec)) 1004 or ((mode ^ st.st_mode) & 0o100 and checkexec))
1005 or size == -2 # other parent 1005 or size == -2 # other parent
1006 or fn in copymap): 1006 or fn in copymap):