1179
1179
pending.extend(d for d in reversed(dirblock) if d[2] == _directory)
1182
_real_walkdirs_utf8 = None
1182
1184
def _walkdirs_utf8(top, prefix=""):
1183
1185
"""Yield data about all the directories in a tree.
1193
1195
path-from-top might be unicode or utf8, but it is the correct path to
1194
1196
pass to os functions to affect the file in question. (such as os.lstat)
1196
fs_encoding = _fs_enc.upper()
1197
if sys.platform == 'win32':
1199
from bzrlib._walkdirs_win32 import _walkdirs_utf8_win32_find_file
1201
return _walkdirs_unicode_to_utf8(top, prefix=prefix)
1198
global _real_walkdirs_utf8
1199
if _real_walkdirs_utf8 is None:
1200
fs_encoding = _fs_enc.upper()
1201
if sys.platform == 'win32':
1203
from bzrlib._walkdirs_win32 import _walkdirs_utf8_win32_find_file
1205
_real_walkdirs_utf8 = _walkdirs_unicode_to_utf8
1207
_real_walkdirs_utf8 = _walkdirs_utf8_win32_find_file
1208
elif fs_encoding not in ('UTF-8', 'US-ASCII', 'ANSI_X3.4-1968'):
1209
# ANSI_X3.4-1968 is a form of ASCII
1210
_real_walkdirs_utf8 = _walkdirs_unicode_to_utf8
1203
return _walkdirs_utf8_win32_find_file(top, prefix=prefix)
1204
if fs_encoding not in ('UTF-8', 'US-ASCII', 'ANSI_X3.4-1968'): # ascii
1205
return _walkdirs_unicode_to_utf8(top, prefix=prefix)
1207
return _walkdirs_fs_utf8(top, prefix=prefix)
1212
_real_walkdirs_utf8 = _walkdirs_fs_utf8
1213
return _real_walkdirs_utf8(top, prefix=prefix)
1210
1216
def _walkdirs_fs_utf8(top, prefix=""):