comparison mercurial/fileset.py @ 38758:774f92710a81 stable

fileset: suppress EACCES while reading arbitrary paths via filectx API On Windows, EACCES is raised in place of EISDIR. This patch simply adds EACCES to the list of errors to be ignored since I think it's okay for filesets to treat inaccessible working-copy files as not existing.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 29 Jul 2018 16:25:51 +0900
parents 3700564c63fe
children af5c0c933af8
comparison
equal deleted inserted replaced
38757:d49e490a9e85 38758:774f92710a81
590 except error.Abort: 590 except error.Abort:
591 return False 591 return False
592 try: 592 try:
593 return predfn(fctx) 593 return predfn(fctx)
594 except (IOError, OSError) as e: 594 except (IOError, OSError) as e:
595 if e.errno in (errno.ENOENT, errno.ENOTDIR, errno.EISDIR): 595 # open()-ing a directory fails with EACCES on Windows
596 if e.errno in (errno.ENOENT, errno.EACCES, errno.ENOTDIR,
597 errno.EISDIR):
596 return False 598 return False
597 raise 599 raise
598 else: 600 else:
599 def fctxpredfn(f): 601 def fctxpredfn(f):
600 try: 602 try: