/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-30 21:30:59 UTC
  • mfrom: (3585.2.4 150438)
  • Revision ID: pqm@pqm.ubuntu.com-20080730213059-hcremsawwvcqjcj1
(robertc) Fix bug 150438 - dirstate corruption due to invalid
        inventory delta objects. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1168
1168
 
1169
1169
        dirblock = []
1170
1170
        append = dirblock.append
1171
 
        for name in sorted(_listdir(top)):
1172
 
            abspath = top_slash + name
1173
 
            statvalue = _lstat(abspath)
1174
 
            kind = _kind_from_mode(statvalue.st_mode & 0170000, 'unknown')
1175
 
            append((relprefix + name, name, kind, statvalue, abspath))
 
1171
        try:
 
1172
            names = sorted(_listdir(top))
 
1173
        except OSError, e:
 
1174
            if getattr(e, 'errno', None) == errno.ENOTDIR:
 
1175
                # We have been asked to examine a file, this is fine.
 
1176
                pass
 
1177
            else:
 
1178
                raise
 
1179
        else:
 
1180
            for name in names:
 
1181
                abspath = top_slash + name
 
1182
                statvalue = _lstat(abspath)
 
1183
                kind = _kind_from_mode(statvalue.st_mode & 0170000, 'unknown')
 
1184
                append((relprefix + name, name, kind, statvalue, abspath))
1176
1185
        yield (relroot, top), dirblock
1177
1186
 
1178
1187
        # push the user specified dirs from dirblock