~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: John Arbash Meinel
  • Date: 2009-10-20 19:46:46 UTC
  • mfrom: (4759 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4771.
  • Revision ID: john@arbash-meinel.com-20091020194646-wnqpd15qs19y28z7
Merge bzr.dev 4759, bringing in static_tuple and streaming improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1132
1132
    bit_iter = iter(rel.split('/'))
1133
1133
    for bit in bit_iter:
1134
1134
        lbit = bit.lower()
1135
 
        for look in _listdir(current):
 
1135
        try:
 
1136
            next_entries = _listdir(current)
 
1137
        except OSError: # enoent, eperm, etc
 
1138
            # We can't find this in the filesystem, so just append the
 
1139
            # remaining bits.
 
1140
            current = pathjoin(current, bit, *list(bit_iter))
 
1141
            break
 
1142
        for look in next_entries:
1136
1143
            if lbit == look.lower():
1137
1144
                current = pathjoin(current, look)
1138
1145
                break
1142
1149
            # the target of a move, for example).
1143
1150
            current = pathjoin(current, bit, *list(bit_iter))
1144
1151
            break
1145
 
    return current[len(abs_base)+1:]
 
1152
    return current[len(abs_base):].lstrip('/')
1146
1153
 
1147
1154
# XXX - TODO - we need better detection/integration of case-insensitive
1148
1155
# file-systems; Linux often sees FAT32 devices (or NFS-mounted OSX