mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
store: add new _exists helper function on fncachestore
This commit is contained in:
parent
f86ce05929
commit
637c55b9a8
@ -512,6 +512,17 @@ class fncachestore(basicstore):
|
||||
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))
|
||||
|
Loading…
Reference in New Issue
Block a user