~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/__init__.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:
25
25
"""
26
26
 
27
27
from cStringIO import StringIO
 
28
from stat import ST_MODE, S_ISDIR
28
29
from zlib import adler32
29
30
 
30
31
from bzrlib.errors import BzrError, UnlistableStore, TransportNotPossible
205
206
 
206
207
    __str__ = __repr__
207
208
 
 
209
    def _iter_relpaths(self):
 
210
        """Iter the relative paths of files in the transports sub-tree."""
 
211
        transport = self._transport
 
212
        queue = list(transport.list_dir('.'))
 
213
        while queue:
 
214
            relpath = queue.pop(0)
 
215
            st = transport.stat(relpath)
 
216
            if S_ISDIR(st[ST_MODE]):
 
217
                for i, basename in enumerate(transport.list_dir(relpath)):
 
218
                    queue.insert(i, relpath+'/'+basename)
 
219
            else:
 
220
                yield relpath, st
 
221
 
208
222
    def listable(self):
209
223
        """Return True if this store is able to be listed."""
210
224
        return self._transport.listable()