~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/text.py

  • Committer: Robert Collins
  • Date: 2005-10-09 23:52:04 UTC
  • Revision ID: robertc@robertcollins.net-20051009235204-0abf18346c658e34
touchup the prefixed-store patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from bzrlib.errors import BzrError, FileExists
30
30
 
31
31
from cStringIO import StringIO
32
 
from stat import ST_SIZE, ST_MODE, S_ISDIR
 
32
from stat import ST_SIZE
33
33
 
34
34
 
35
35
class TextStore(bzrlib.store.TransportStore):
137
137
            yield None
138
138
            count += 1
139
139
 
140
 
    def _iter_relpaths(self):
141
 
        transport = self._transport
142
 
        queue = list(transport.list_dir('.'))
143
 
        while queue:
144
 
            relpath = queue.pop(0)
145
 
            st = transport.stat(relpath)
146
 
            if S_ISDIR(st[ST_MODE]):
147
 
                for i, basename in enumerate(transport.list_dir(relpath)):
148
 
                    queue.insert(i, relpath+'/'+basename)
149
 
            else:
150
 
                yield relpath, st
151
 
 
152
140
    def __iter__(self):
153
141
        for relpath, st in self._iter_relpaths():
154
142
            yield os.path.basename(relpath)