diff mercurial/vfs.py @ 49912:bc83ebe07bf0

pathauditor: make _checkfs_exists a static method This fixes the bug detected by pytype where the auditor used in vfs.py may be a no-op auditor (vfs.py, line 398), which doesn't have the _checkfs_exists method.
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Thu, 12 Jan 2023 16:15:51 +0000
parents b7cf91ef03ba
children d1d458fb96a5
line wrap: on
line diff
--- a/mercurial/vfs.py	Thu Jan 12 13:14:00 2023 +0000
+++ b/mercurial/vfs.py	Thu Jan 12 16:15:51 2023 +0000
@@ -427,13 +427,19 @@
     ) -> bool:
         """return True if the path is a regular file or a symlink and
         the directories along the path are "normal", that is
-        not symlinks or nested hg repositories."""
+        not symlinks or nested hg repositories.
+
+        Ignores the `_audit` setting, and checks the directories regardless.
+        `dircache` is used to cache the directory checks.
+        """
         try:
             for prefix in pathutil.finddirs_rev_noroot(util.localpath(path)):
                 if prefix in dircache:
                     res = dircache[prefix]
                 else:
-                    res = self.audit._checkfs_exists(prefix, path)
+                    res = pathutil.pathauditor._checkfs_exists(
+                        self.base, prefix, path
+                    )
                     dircache[prefix] = res
                 if not res:
                     return False