~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-04 04:38:48 UTC
  • mfrom: (1400.1.1)
  • Revision ID: robertc@robertcollins.net-20051004043848-d65bb5f9d435fbb3
unbreak http branch operations

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
            else:
87
87
                yield False
88
88
 
 
89
    def listable(self):
 
90
        """Return True if this store is able to be listed."""
 
91
        return hasattr(self, "__iter__")
 
92
 
89
93
    def get(self, fileids, permit_failure=False, pb=None):
90
94
        """Return a set of files, one for each requested entry.
91
95
        
200
204
 
201
205
    __str__ = __repr__
202
206
 
 
207
    def listable(self):
 
208
        """Return True if this store is able to be listed."""
 
209
        return self._transport.listable()
 
210
 
203
211
 
204
212
class ImmutableMemoryStore(Store):
205
213
    """A memory only store."""
294
302
def copy_all(store_from, store_to):
295
303
    """Copy all ids from one store to another."""
296
304
    # TODO: Optional progress indicator
297
 
    if not hasattr(store_from, "__iter__"):
298
 
        raise UnlistableStore(store_from)
299
 
    try:
300
 
        ids = [f for f in store_from]
301
 
    except (NotImplementedError, TransportNotPossible):
302
 
        raise UnlistableStore(store_from)
 
305
    if not store_from.listable():
 
306
        raise UnlistableStore(store_from)
 
307
    ids = [f for f in store_from]
303
308
    store_to.copy_multi(store_from, ids)
304
309