comparison hgext/largefiles/lfcommands.py @ 17155:88ff28bcd980

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.
author Na'Tosha Bard <natosha@unity3d.com>
date Fri, 13 Jul 2012 14:49:16 +0200
parents 9e1616307c4c
children e51d4aedace9
comparison
equal deleted inserted replaced
17154:d592759aabc7 17155:88ff28bcd980
481 # use normallookup() to allocate entry in largefiles dirstate, 481 # use normallookup() to allocate entry in largefiles dirstate,
482 # because lack of it misleads lfilesrepo.status() into 482 # because lack of it misleads lfilesrepo.status() into
483 # recognition that such cache missing files are REMOVED. 483 # recognition that such cache missing files are REMOVED.
484 lfdirstate.normallookup(lfile) 484 lfdirstate.normallookup(lfile)
485 return None # don't try to set the mode 485 return None # don't try to set the mode
486 else:
487 # Synchronize largefile dirstate to the last modified time of
488 # the file
489 lfdirstate.normal(lfile)
486 ret = 1 490 ret = 1
487 mode = os.stat(absstandin).st_mode 491 mode = os.stat(absstandin).st_mode
488 if mode != os.stat(abslfile).st_mode: 492 if mode != os.stat(abslfile).st_mode:
489 os.chmod(abslfile, mode) 493 os.chmod(abslfile, mode)
490 ret = 1 494 ret = 1