/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Andrew Bennetts
  • Date: 2007-08-30 08:11:54 UTC
  • mfrom: (2766 +trunk)
  • mto: (2535.3.55 repo-refactor)
  • mto: This revision was merged to the branch mainline in revision 2772.
  • Revision ID: andrew.bennetts@canonical.com-20070830081154-16hebp2xwr15x2hc
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    osutils,
34
34
    urlutils,
35
35
    symbol_versioning,
 
36
    transport,
36
37
    )
37
38
from bzrlib.trace import mutter
38
39
from bzrlib.transport import LateReadError
65
66
        super(LocalTransport, self).__init__(base)
66
67
        self._local_base = urlutils.local_path_from_url(base)
67
68
 
68
 
    def should_cache(self):
69
 
        return False
70
 
 
71
69
    def clone(self, offset=None):
72
70
        """Return a new LocalTransport with root at self.base + offset
73
71
        Because the local filesystem does not require a connection, 
138
136
 
139
137
        :param relpath: The relative path to the file
140
138
        """
 
139
        canonical_url = self.abspath(relpath)
 
140
        if canonical_url in transport._file_streams:
 
141
            transport._file_streams[canonical_url].flush()
141
142
        try:
142
143
            path = self._abspath(relpath)
143
144
            return open(path, 'rb')
301
302
        """Create a directory at the given path."""
302
303
        self._mkdir(self._abspath(relpath), mode=mode)
303
304
 
 
305
    def open_write_stream(self, relpath, mode=None):
 
306
        """See Transport.open_write_stream."""
 
307
        # initialise the file
 
308
        self.put_bytes_non_atomic(relpath, "", mode=mode)
 
309
        handle = open(self._abspath(relpath), 'wb')
 
310
        transport._file_streams[self.abspath(relpath)] = handle
 
311
        return transport.FileFileStream(self, relpath, handle)
 
312
 
304
313
    def _get_append_file(self, relpath, mode=None):
305
314
        """Call os.open() for the given relpath"""
306
315
        file_abspath = self._abspath(relpath)