largefiles: optimize status by synchronizing lfdirstate with the largefile on update
authorNa'Tosha Bard <natosha@unity3d.com>
Fri, 13 Jul 2012 14:49:16 +0200
changeset 17155 88ff28bcd980
parent 17154 d592759aabc7
child 17156 7034365089bf
largefiles: optimize status by synchronizing lfdirstate with the largefile on update This speeds up status on a largefiles repo by synchronizing the largefiles dirstate to the largefile's mtime upon update, preventing the files from coming back as "unsure" later, requiring a check of the SHA1 sum.
hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py	Mon Jun 25 15:14:06 2012 -0700
+++ b/hgext/largefiles/lfcommands.py	Fri Jul 13 14:49:16 2012 +0200
@@ -483,6 +483,10 @@
                 # 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
+                lfdirstate.normal(lfile)
             ret = 1
         mode = os.stat(absstandin).st_mode
         if mode != os.stat(abslfile).st_mode: