[Updated] [+- ] D11800: largefile: use the proper "mtime boundary" logic during fixup

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Tue Nov 30 23:56:32 UTC 2021


marmoute updated this revision to Diff 31233.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11800?vs=31122&id=31233

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11800/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11800

AFFECTED FILES
  hgext/largefiles/lfutil.py
  hgext/largefiles/reposetup.py

CHANGE DETAILS

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -228,13 +228,12 @@
                                 s = wctx[lfile].lstat()
                                 mode = s.st_mode
                                 size = s.st_size
-                                mtime = timestamp.mtime_of(s)
-                                cache_data = (mode, size, mtime)
-                                # We should consider using the mtime_boundary
-                                # logic here, but largefile never actually had
-                                # ambiguity protection before, so this confuse
-                                # the tests and need more thinking.
-                                lfdirstate.set_clean(lfile, cache_data)
+                                mtime = timestamp.reliable_mtime_of(
+                                    s, mtime_boundary
+                                )
+                                if mtime is not None:
+                                    cache_data = (mode, size, mtime)
+                                    lfdirstate.set_clean(lfile, cache_data)
                     else:
                         tocheck = unsure + modified + added + clean
                         modified, added, clean = [], [], []
diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -261,13 +261,10 @@
             st = wctx[lfile].lstat()
             mode = st.st_mode
             size = st.st_size
-            mtime = timestamp.mtime_of(st)
-            cache_data = (mode, size, mtime)
-            # We should consider using the mtime_boundary
-            # logic here, but largefile never actually had
-            # ambiguity protection before, so this confuse
-            # the tests and need more thinking.
-            lfdirstate.set_clean(lfile, cache_data)
+            mtime = timestamp.reliable_mtime_of(st, mtime_boundary)
+            if mtime is not None:
+                cache_data = (mode, size, mtime)
+                lfdirstate.set_clean(lfile, cache_data)
     return s
 
 



To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211130/f606ab48/attachment-0002.html>


More information about the Mercurial-patches mailing list