store: fncache may contain non-existent entries (fixes b9a56b816ff2)
authorAdrian Buehlmann <adrian@cadifra.com>
Fri, 12 Oct 2012 10:52:33 +0200
changeset 17784 73e1ab39792c
parent 17783 df55ce6854c3
child 17785 ac5c9c8046f7
store: fncache may contain non-existent entries (fixes b9a56b816ff2)
mercurial/store.py
--- a/mercurial/store.py	Fri Oct 12 10:52:32 2012 +0200
+++ b/mercurial/store.py	Fri Oct 12 10:52:33 2012 +0200
@@ -527,13 +527,14 @@
         '''Checks if the store contains path'''
         path = "/".join(("data", path))
         # check for files (exact match)
-        if path + '.i' in self.fncache:
+        e = path + '.i'
+        if e in self.fncache and self._exists(e):
             return True
         # now check for directories (prefix match)
         if not path.endswith('/'):
             path += '/'
         for e in self.fncache:
-            if e.startswith(path):
+            if e.startswith(path) and self._exists(e):
                 return True
         return False