mercurial/pathutil.py
changeset 49981 789e152a6bdb
parent 49980 7623d79f872c
child 49985 bc83ebe07bf0
equal deleted inserted replaced
49980:7623d79f872c 49981:789e152a6bdb
   105                         _(b"path '%s' is inside nested repo %r")
   105                         _(b"path '%s' is inside nested repo %r")
   106                         % (path, pycompat.bytestr(base))
   106                         % (path, pycompat.bytestr(base))
   107                     )
   107                     )
   108 
   108 
   109         if self._realfs:
   109         if self._realfs:
   110             parts.pop()
       
   111             # It's important that we check the path parts starting from the root.
   110             # It's important that we check the path parts starting from the root.
   112             # We don't want to add "foo/bar/baz" to auditeddir before checking if
   111             # We don't want to add "foo/bar/baz" to auditeddir before checking if
   113             # there's a "foo/.hg" directory. This also means we won't accidentally
   112             # there's a "foo/.hg" directory. This also means we won't accidentally
   114             # traverse a symlink into some other filesystem (which is potentially
   113             # traverse a symlink into some other filesystem (which is potentially
   115             # expensive to access).
   114             # expensive to access).
   116             for i in range(len(parts)):
   115             for prefix in finddirs_rev_noroot(path):
   117                 prefix = pycompat.ossep.join(parts[: i + 1])
       
   118                 if prefix in self.auditeddir:
   116                 if prefix in self.auditeddir:
   119                     res = self.auditeddir[prefix]
   117                     res = self.auditeddir[prefix]
   120                 else:
   118                 else:
   121                     res = self._checkfs_exists(prefix, path)
   119                     res = self._checkfs_exists(prefix, path)
   122                     if self._cached:
   120                     if self._cached: