~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

Fix the way we used osutils.normalized_filename in dirstate to support overriding in tests - and document this in the original location it was used.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
    trace,
122
122
    )
123
123
import bzrlib.inventory
 
124
from bzrlib import osutils
124
125
from bzrlib.osutils import (
125
 
    normalized_filename,
126
126
    pathjoin,
127
127
    sha_file,
128
128
    sha_string,
203
203
        #------- copied from bzrlib.inventory.make_entry
204
204
        # --- normalized_filename wants a unicode basename only, so get one.
205
205
        dirname, basename = os.path.split(path)
206
 
        norm_name, can_access = normalized_filename(basename)
 
206
        # we dont import normalized_filename directly because we want to be
 
207
        # able to change the implementation at runtime for tests.
 
208
        norm_name, can_access = osutils.normalized_filename(basename)
207
209
        if norm_name != basename:
208
210
            if can_access:
209
211
                basename = norm_name