hgext/largefiles/lfutil.py
changeset 48382 991e6f728b50
parent 48169 1e98f9b5bc71
child 48390 322525db4c98
--- a/hgext/largefiles/lfutil.py	Wed Nov 17 23:37:47 2021 +0100
+++ b/hgext/largefiles/lfutil.py	Thu Nov 18 22:46:50 2021 +0100
@@ -32,6 +32,7 @@
     vfs as vfsmod,
 )
 from mercurial.utils import hashutil
+from mercurial.dirstateutils import timestamp
 
 shortname = b'.hglf'
 shortnameslash = shortname + b'/'
@@ -247,6 +248,7 @@
         match, subrepos=[], ignored=False, clean=False, unknown=False
     )
     modified, clean = s.modified, s.clean
+    wctx = repo[None]
     for lfile in unsure:
         try:
             fctx = pctx[standin(lfile)]
@@ -256,7 +258,12 @@
             modified.append(lfile)
         else:
             clean.append(lfile)
-            lfdirstate.set_clean(lfile)
+            st = wctx[lfile].lstat()
+            mode = st.st_mode
+            size = st.st_size
+            mtime = timestamp.mtime_of(st)
+            cache_data = (mode, size, mtime)
+            lfdirstate.set_clean(lfile, cache_data)
     return s