/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-07-17 13:27:12 UTC
  • mfrom: (3504.4.15 win32_find_files)
  • Revision ID: pqm@pqm.ubuntu.com-20080717132712-1zbt1asfsuslh1v9
(jam) Implement _walkdirs_win32,
        going directly to Win32 apis improves status performance 2-6x

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    )
54
54
""")
55
55
 
 
56
 
56
57
import bzrlib
57
58
from bzrlib import symbol_versioning
58
59
from bzrlib.symbol_versioning import (
1193
1194
        pass to os functions to affect the file in question. (such as os.lstat)
1194
1195
    """
1195
1196
    fs_encoding = _fs_enc.upper()
1196
 
    if (sys.platform == 'win32' or
1197
 
        fs_encoding not in ('UTF-8', 'US-ASCII', 'ANSI_X3.4-1968')): # ascii
 
1197
    if sys.platform == 'win32':
 
1198
        try:
 
1199
            from bzrlib._walkdirs_win32 import _walkdirs_utf8_win32_find_file
 
1200
        except ImportError:
 
1201
            return _walkdirs_unicode_to_utf8(top, prefix=prefix)
 
1202
        else:
 
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
1198
1205
        return _walkdirs_unicode_to_utf8(top, prefix=prefix)
1199
1206
    else:
1200
1207
        return _walkdirs_fs_utf8(top, prefix=prefix)