diff tests/fakedirstatewritetime.py @ 48260:269ff8978086

dirstate: store mtimes with nanosecond precision in memory Keep integer seconds since the Unix epoch, together with integer nanoseconds in the `0 <= n < 1e9` range. For now, nanoseconds are still always zero. This commit is about data structure changes. Differential Revision: https://phab.mercurial-scm.org/D11684
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 18 Oct 2021 11:23:07 +0200
parents 1194394510ba
children 08b060abd658
line wrap: on
line diff
--- a/tests/fakedirstatewritetime.py	Tue Oct 19 21:03:13 2021 +0200
+++ b/tests/fakedirstatewritetime.py	Mon Oct 18 11:23:07 2021 +0200
@@ -15,6 +15,7 @@
     policy,
     registrar,
 )
+from mercurial.dirstateutils import timestamp
 from mercurial.utils import dateutil
 
 try:
@@ -40,9 +41,8 @@
 def pack_dirstate(fakenow, orig, dmap, copymap, pl, now):
     # execute what original parsers.pack_dirstate should do actually
     # for consistency
-    actualnow = int(now)
     for f, e in dmap.items():
-        if e.need_delay(actualnow):
+        if e.need_delay(now):
             e.set_possibly_dirty()
 
     return orig(dmap, copymap, pl, fakenow)
@@ -62,6 +62,7 @@
     # parsing 'fakenow' in YYYYmmddHHMM format makes comparison between
     # 'fakenow' value and 'touch -t YYYYmmddHHMM' argument easy
     fakenow = dateutil.parsedate(fakenow, [b'%Y%m%d%H%M'])[0]
+    fakenow = timestamp.timestamp((fakenow, 0))
 
     if has_rust_dirstate:
         # The Rust implementation does not use public parse/pack dirstate