hgext/largefiles/reposetup.py
changeset 48382 991e6f728b50
parent 48168 df3021c1f093
child 48390 322525db4c98
--- a/hgext/largefiles/reposetup.py	Wed Nov 17 23:37:47 2021 +0100
+++ b/hgext/largefiles/reposetup.py	Thu Nov 18 22:46:50 2021 +0100
@@ -22,6 +22,8 @@
     util,
 )
 
+from mercurial.dirstateutils import timestamp
+
 from . import (
     lfcommands,
     lfutil,
@@ -210,6 +212,7 @@
                         s.clean,
                     )
                     if parentworking:
+                        wctx = repo[None]
                         for lfile in unsure:
                             standin = lfutil.standin(lfile)
                             if standin not in ctx1:
@@ -222,7 +225,12 @@
                             else:
                                 if listclean:
                                     clean.append(lfile)
-                                lfdirstate.set_clean(lfile)
+                                s = wctx[lfile].lstat()
+                                mode = s.st_mode
+                                size = s.st_size
+                                mtime = timestamp.mtime_of(s)
+                                cache_data = (mode, size, mtime)
+                                lfdirstate.set_clean(lfile, cache_data)
                     else:
                         tocheck = unsure + modified + added + clean
                         modified, added, clean = [], [], []