##// END OF EJS Templates
status: keep second-ambiguous mtimes during fixup...
marmoute -
r49232:ca42667c default
parent child Browse files
Show More
@@ -102,16 +102,23 b' def reliable_mtime_of(stat_result, prese'
102 102 """
103 103 file_mtime = mtime_of(stat_result)
104 104 file_second = file_mtime[0]
105 file_ns = file_mtime[1]
105 106 boundary_second = present_mtime[0]
107 boundary_ns = present_mtime[1]
106 108 # If the mtime of the ambiguous file is younger (or equal) to the starting
107 109 # point of the `status` walk, we cannot garantee that another, racy, write
108 110 # will not happen right after with the same mtime and we cannot cache the
109 111 # information.
110 112 #
111 # However is the mtime is far away in the future, this is likely some
113 # However if the mtime is far away in the future, this is likely some
112 114 # mismatch between the current clock and previous file system operation. So
113 115 # mtime more than one days in the future are considered fine.
114 if boundary_second <= file_second < (3600 * 24 + boundary_second):
116 if boundary_second == file_second:
117 if file_ns and boundary_ns:
118 if file_ns < boundary_ns:
119 return timestamp((file_second, file_ns, True))
120 return None
121 elif boundary_second < file_second < (3600 * 24 + boundary_second):
115 122 return None
116 123 else:
117 124 return file_mtime
General Comments 0
You need to be logged in to leave comments. Login now