mercurial/posix.py
changeset 14927 2aa3e07b2f07
parent 14926 4e7e63fc685a
child 15011 5e44e4b3a0a3
--- a/mercurial/posix.py	Sat Jul 23 12:29:52 2011 +0200
+++ b/mercurial/posix.py	Mon Jul 25 15:03:02 2011 +0300
@@ -349,5 +349,21 @@
     """
     pass
 
+class cachestat(object):
+    def __init__(self, path):
+        self.stat = os.stat(path)
+
+    def cacheable(self):
+        return bool(self.stat.st_ino)
+
+    def __eq__(self, other):
+        try:
+            return self.stat == other.stat
+        except AttributeError:
+            return False
+
+    def __ne__(self, other):
+        return not self == other
+
 def executablepath():
     return None # available on Windows only