[PATCH 4 of 4] store: fncache may contain non-existent entries (fixes b9a56b816ff2)

Adrian Buehlmann adrian at cadifra.com
Fri Oct 12 04:02:05 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1350031953 -7200
# Node ID 88c6f4ce158c31137fe2680c30d8bc1deec041d2
# Parent  23f54761eb31c5ab52f939bea98f78d396c7997c
store: fncache may contain non-existent entries (fixes b9a56b816ff2)

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -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
 


More information about the Mercurial-devel mailing list