diff -r 6047947afb6b -r 09d5b2055295 mercurial/store.py --- 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')