mercurial/pathutil.py
changeset 44358 d52e3826cd4b
parent 44195 51c86c6167c1
child 44626 11f284c8c5e4
equal deleted inserted replaced
44357:bed8d08cfcb2 44358:d52e3826cd4b
    98         assert len(parts) == len(normparts)
    98         assert len(parts) == len(normparts)
    99 
    99 
   100         parts.pop()
   100         parts.pop()
   101         normparts.pop()
   101         normparts.pop()
   102         # It's important that we check the path parts starting from the root.
   102         # It's important that we check the path parts starting from the root.
   103         # This means we won't accidentally traverse a symlink into some other
   103         # We don't want to add "foo/bar/baz" to auditeddir before checking if
   104         # filesystem (which is potentially expensive to access).
   104         # there's a "foo/.hg" directory. This also means we won't accidentally
       
   105         # traverse a symlink into some other filesystem (which is potentially
       
   106         # expensive to access).
   105         for i in range(len(parts)):
   107         for i in range(len(parts)):
   106             prefix = pycompat.ossep.join(parts[: i + 1])
   108             prefix = pycompat.ossep.join(parts[: i + 1])
   107             normprefix = pycompat.ossep.join(normparts[: i + 1])
   109             normprefix = pycompat.ossep.join(normparts[: i + 1])
   108             if normprefix in self.auditeddir:
   110             if normprefix in self.auditeddir:
   109                 continue
   111                 continue