diff mercurial/dirstateutils/timestamp.py @ 48446:111098af6356

dirstate-item: add a "second_ambiguous` flag in the mtime tuple This will be used to support the `mtime-second-ambiguous` flag from dirstate v2. See format documentation for details. For now, we only make it possible to store the information, no other logic have been added. Differential Revision: https://phab.mercurial-scm.org/D11842
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 24 Nov 2021 04:40:00 +0100
parents 8d585aa9becf
children ca42667c8d26
line wrap: on
line diff
--- a/mercurial/dirstateutils/timestamp.py	Tue Nov 23 19:27:17 2021 +0100
+++ b/mercurial/dirstateutils/timestamp.py	Wed Nov 24 04:40:00 2021 +0100
@@ -31,8 +31,8 @@
     """
 
     def __new__(cls, value):
-        truncated_seconds, subsec_nanos = value
-        value = (truncated_seconds & rangemask, subsec_nanos)
+        truncated_seconds, subsec_nanos, second_ambiguous = value
+        value = (truncated_seconds & rangemask, subsec_nanos, second_ambiguous)
         return super(timestamp, cls).__new__(cls, value)
 
     def __eq__(self, other):
@@ -89,7 +89,7 @@
         secs = nanos // billion
         subsec_nanos = nanos % billion
 
-    return timestamp((secs, subsec_nanos))
+    return timestamp((secs, subsec_nanos, False))
 
 
 def reliable_mtime_of(stat_result, present_mtime):