Skip to content
Snippets Groups Projects
Commit 6f750e76fb46 authored by Benoit Boissinot's avatar Benoit Boissinot
Browse files

dirstate.walk: skip unreadable directories (issue1213)

Do not abort on permission denied error, just skip the directory.
parent 8a5c88c7e97b
No related branches found
No related tags found
No related merge requests found
......@@ -492,5 +492,6 @@
nd = work.pop()
if hasattr(match, 'dir'):
match.dir(nd)
skip = None
if nd == '.':
nd = ''
......@@ -495,4 +496,3 @@
if nd == '.':
nd = ''
entries = listdir(join(nd), stat=True)
else:
......@@ -498,5 +498,12 @@
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:
......
......@@ -16,3 +16,10 @@
chmod -w .
hg diff --nodates
chmod +w .
chmod +w .hg/store/data/a.i
mkdir dir
touch dir/a
hg status
chmod -rx dir
hg status
......@@ -20,3 +20,7 @@
@@ -1,1 +1,1 @@
-foo
+barber
M a
? dir/a
dir: Permission denied
M a
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment