[PATCH] largefiles: synchronize status by synchronizing the files mtime with the lfdirstate on update
Na'Tosha Bard
natosha at unity3d.com
Thu Jul 12 09:36:12 CDT 2012
# HG changeset patch
# User Na'Tosha Bard <natosha at unity3d.com>
# Date 1342103731 -7200
# Node ID b1e224d7416bfb46f2727519569ffb935896ee5f
# Parent c496de2ce56316d9adf3820473f68e29438a1a5f
largefiles: synchronize status by synchronizing the files mtime with the lfdirstate on update
This speeds up status on a largefiles repo by synchronizing largefiles' mtime to what is in
the lfdirstate upon update, preventing the files from coming back as "unsure" later, requiring
a check of the SHA1 sum.
diff -r c496de2ce563 -r b1e224d7416b hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py Wed Jul 11 11:41:38 2012 +0200
+++ b/hgext/largefiles/lfcommands.py Thu Jul 12 16:35:31 2012 +0200
@@ -483,6 +483,12 @@
# recognition that such cache missing files are REMOVED.
lfdirstate.normallookup(lfile)
return None # don't try to set the mode
+ else:
+ # Synchronize largefile dirstate to the last modified time of
+ # the file
+ s = os.lstat(repo.wjoin(lfile))
+ mtime = int(s.st_mtime)
+ lfdirstate._addpath(lfile, 'n', s.st_mode, s.st_size, mtime)
ret = 1
mode = os.stat(absstandin).st_mode
if mode != os.stat(abslfile).st_mode:
More information about the Mercurial-devel
mailing list