mercurial/dirstate.py
branchstable
changeset 21931 89b809fa6cef
parent 21810 4b2ebd3187a1
child 21984 977a0b9af5ac
--- a/mercurial/dirstate.py	Mon Jul 21 11:27:24 2014 -0700
+++ b/mercurial/dirstate.py	Tue Jul 22 23:59:30 2014 +0900
@@ -504,6 +504,14 @@
     def write(self):
         if not self._dirty:
             return
+
+        # enough 'delaywrite' prevents 'pack_dirstate' from dropping
+        # timestamp of each entries in dirstate, because of 'now > mtime'
+        delaywrite = self._ui.configint('debug', 'dirstate.delaywrite', 0)
+        if delaywrite:
+            import time # to avoid useless import
+            time.sleep(delaywrite)
+
         st = self._opener("dirstate", "w", atomictemp=True)
         # use the modification time of the newly created temporary file as the
         # filesystem's notion of 'now'