/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: Robert Collins
  • Date: 2008-08-20 03:30:17 UTC
  • mto: This revision was merged to the branch mainline in revision 3682.
  • Revision ID: robertc@robertcollins.net-20080820033017-q8y6stxz8f5kxu9y
Update readdir pyrex source files and usage in line with current practice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
 
56
56
 
57
57
import bzrlib
58
 
from bzrlib.readdir import read_dir
59
58
from bzrlib import symbol_versioning
60
59
from bzrlib.symbol_versioning import (
61
60
    deprecated_function,
1278
1277
 
1279
1278
        dirblock = []
1280
1279
        append = dirblock.append
1281
 
        for name, kind in sorted(_listdir(top)):
 
1280
        # read_dir supplies in should-stat order.
 
1281
        for _, name in sorted(_listdir(top)):
1282
1282
            abspath = top_slash + name
1283
 
            if kind == 'unknown':
1284
 
                statvalue = _lstat(abspath)
1285
 
                kind = _kind_from_mode(statvalue.st_mode & 0170000, 'unknown')
1286
 
            else:
1287
 
                statvalue = None
1288
 
                statvalue = _lstat(abspath)
1289
 
                kind = _kind_from_mode(statvalue.st_mode & 0170000, 'unknown')
 
1283
            statvalue = _lstat(abspath)
 
1284
            kind = _kind_from_mode(statvalue.st_mode & 0170000, 'unknown')
1290
1285
            append((relprefix + name, name, kind, statvalue, abspath))
 
1286
        dirblock.sort()
1291
1287
        yield (relroot, top), dirblock
1292
1288
 
1293
1289
        # push the user specified dirs from dirblock
1532
1528
        base = abspath(pathjoin(base, '..', '..'))
1533
1529
    filename = pathjoin(base, resource_relpath)
1534
1530
    return open(filename, 'rU').read()
 
1531
 
 
1532
 
 
1533
try:
 
1534
    from bzrlib._readdir_pyx import read_dir
 
1535
except ImportError:
 
1536
    from bzrlib._readdir_py import read_dir