~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/compressed_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 StringIO import StringIO
32
 
from stat import ST_SIZE, ST_MODE, S_ISDIR
 
32
from stat import ST_SIZE
33
33
 
34
34
class CompressedTextStore(bzrlib.store.TransportStore):
35
35
    """Store that holds files indexed by unique names.
206
206
            yield None
207
207
            count += 1
208
208
 
209
 
    def _iter_relpaths(self):
210
 
        transport = self._transport
211
 
        queue = list(transport.list_dir('.'))
212
 
        while queue:
213
 
            relpath = queue.pop(0)
214
 
            st = transport.stat(relpath)
215
 
            if S_ISDIR(st[ST_MODE]):
216
 
                for i, basename in enumerate(transport.list_dir(relpath)):
217
 
                    queue.insert(i, relpath+'/'+basename)
218
 
            else:
219
 
                yield relpath, st
220
 
 
221
209
    def __iter__(self):
222
210
        for relpath, st in self._iter_relpaths():
223
211
            if relpath.endswith(".gz"):