502 self.audit(path, mode=mode) |
502 self.audit(path, mode=mode) |
503 |
503 |
504 def isfileorlink_checkdir( |
504 def isfileorlink_checkdir( |
505 self, |
505 self, |
506 dircache: MutableMapping[bytes, bool], |
506 dircache: MutableMapping[bytes, bool], |
507 path: Optional[bytes] = None, |
507 path: bytes, |
508 ) -> bool: |
508 ) -> bool: |
509 """return True if the path is a regular file or a symlink and |
509 """return True if the path is a regular file or a symlink and |
510 the directories along the path are "normal", that is |
510 the directories along the path are "normal", that is |
511 not symlinks or nested hg repositories. |
511 not symlinks or nested hg repositories. |
512 |
512 |
513 Ignores the `_audit` setting, and checks the directories regardless. |
513 Ignores the `_audit` setting, and checks the directories regardless. |
514 `dircache` is used to cache the directory checks. |
514 `dircache` is used to cache the directory checks. |
515 """ |
515 """ |
516 # TODO: Should be a None check on 'path', or shouldn't default to None |
|
517 # because of the immediate call to util.localpath(). |
|
518 try: |
516 try: |
519 for prefix in pathutil.finddirs_rev_noroot(util.localpath(path)): |
517 for prefix in pathutil.finddirs_rev_noroot(util.localpath(path)): |
520 if prefix in dircache: |
518 if prefix in dircache: |
521 res = dircache[prefix] |
519 res = dircache[prefix] |
522 else: |
520 else: |