# HG changeset patch # User Adrian Buehlmann # Date 1350031952 -7200 # Node ID df55ce6854c315b6bad868f177b4c4b212d3f743 # Parent 8095306c1fb2f90e5c41486a0e9569d5a69010ea store: add new _exists helper function on fncachestore diff -r 8095306c1fb2 -r df55ce6854c3 mercurial/store.py --- a/mercurial/store.py Fri Oct 12 10:40:09 2012 +0200 +++ b/mercurial/store.py Fri Oct 12 10:52:32 2012 +0200 @@ -512,6 +512,17 @@ def write(self): self.fncache.write() + def _exists(self, f): + ef = self.encode(f) + try: + self.getsize(ef) + return True + except OSError, err: + if err.errno != errno.ENOENT: + raise + # nonexistent entry + return False + def __contains__(self, path): '''Checks if the store contains path''' path = "/".join(("data", path))