~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:37:29 UTC
  • mto: This revision was merged to the branch mainline in revision 1401.
  • Revision ID: robertc@robertcollins.net-20051004043729-562c506f88535c26
implement a basic test for the ui branch command from http servers

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