~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-10 03:24:15 UTC
  • Revision ID: robertc@robertcollins.net-20051010032415-2d3840758bc6e9b8
merge in and make incremental Gustavo Niemeyers nested log patch, and remove all bare exceptions in store and transport packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from stat import ST_MODE, S_ISDIR
29
29
from zlib import adler32
30
30
 
 
31
import bzrlib.errors as errors
31
32
from bzrlib.errors import BzrError, UnlistableStore, TransportNotPossible
32
33
from bzrlib.trace import mutter
33
34
import bzrlib.transport
193
194
 
194
195
    _max_buffered_requests = 10
195
196
 
 
197
    def __getitem__(self, fileid):
 
198
        """Returns a file reading from a particular entry."""
 
199
        fn = self._relpath(fileid)
 
200
        try:
 
201
            return self._transport.get(fn)
 
202
        except errors.NoSuchFile:
 
203
            raise KeyError(fileid)
 
204
 
196
205
    def __init__(self, transport):
197
206
        assert isinstance(transport, bzrlib.transport.Transport)
198
207
        super(TransportStore, self).__init__()