Mercurial > hg-stable
changeset 7099:6f750e76fb46
dirstate.walk: skip unreadable directories (issue1213)
Do not abort on permission denied error, just skip the directory.
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 15 Oct 2008 14:52:27 +0200 |
parents | 8a5c88c7e97b |
children | baf12d52add4 |
files | mercurial/dirstate.py tests/test-permissions tests/test-permissions.out |
diffstat | 3 files changed, 20 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dirstate.py Wed Oct 15 14:06:46 2008 +0200 +++ b/mercurial/dirstate.py Wed Oct 15 14:52:27 2008 +0200 @@ -492,11 +492,18 @@ nd = work.pop() if hasattr(match, 'dir'): match.dir(nd) + skip = None if nd == '.': nd = '' - entries = listdir(join(nd), stat=True) else: - entries = listdir(join(nd), stat=True, skip ='.hg') + skip = '.hg' + try: + entries = listdir(join(nd), stat=True, skip=skip) + except OSError, inst: + if inst.errno == errno.EACCES: + fwarn(nd, inst.strerror) + continue + raise for f, kind, st in entries: nf = normalize(nd and (nd + "/" + f) or f, True) if nf not in results: