diff mercurial/util.py @ 32835:1b25c648d5b7

fsmonitor: don't write out state if identity has changed (issue5581) Inspired by the dirstate fix in dc7efa2826e4, this should fix any race conditions with the fsmonitor state changing from underneath. Since we now grab the wlock for any non-invalidate writes, the only situation this appears to happen in is with a concurrent invalidation. Test that.
author Siddharth Agarwal <sid0@fb.com>
date Mon, 12 Jun 2017 15:34:31 -0700
parents 7ad95626f6a7
children 19b0fd4b5570
line wrap: on
line diff
--- a/mercurial/util.py	Mon Jun 12 15:34:31 2017 -0700
+++ b/mercurial/util.py	Mon Jun 12 15:34:31 2017 -0700
@@ -1519,6 +1519,11 @@
             stat = None
         return cls(stat)
 
+    @classmethod
+    def fromfp(cls, fp):
+        stat = os.fstat(fp.fileno())
+        return cls(stat)
+
     __hash__ = object.__hash__
 
     def __eq__(self, old):