mercurial/store.py
changeset 17744 09d5b2055295
parent 17738 b8424c92ba2b
child 17745 b9a56b816ff2
--- a/mercurial/store.py	Wed Oct 10 01:37:54 2012 +0200
+++ b/mercurial/store.py	Thu Sep 13 17:00:34 2012 -0700
@@ -341,6 +341,17 @@
     def write(self):
         pass
 
+    def __contains__(self, path):
+        '''Checks if the store contains path'''
+        path = "/".join(("data", path))
+        # file?
+        if os.path.exists(self.join(path + ".i")):
+            return True
+        # dir?
+        if not path.endswith("/"):
+            path = path + "/"
+        return os.path.exists(self.join(path))
+
 class encodedstore(basicstore):
     def __init__(self, path, vfstype):
         vfs = vfstype(path + '/store')