~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-13 06:08:53 UTC
  • mfrom: (4737.1.1 merge-2.0-into-devel)
  • Revision ID: pqm@pqm.ubuntu.com-20091013060853-erk2aaj80fnkrv25
(andrew) Merge lp:bzr/2.0 into lp:bzr, including fixes for #322807,
        #389413, #402623 and documentation 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