~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-07 06:08:01 UTC
  • mto: This revision was merged to the branch mainline in revision 5491.
  • Revision ID: v.ladeuil+lp@free.fr-20101007060801-wfdhizfhfmctl8qa
Fix some typos and propose a release planning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
20
20
"""
21
21
 
22
22
import os
23
 
from stat import ST_MODE, S_ISDIR, S_IMODE
 
23
from stat import ST_MODE, S_ISDIR, ST_SIZE, S_IMODE
24
24
import sys
25
25
 
26
26
from bzrlib.lazy_import import lazy_import
33
33
    osutils,
34
34
    urlutils,
35
35
    symbol_versioning,
 
36
    transport,
36
37
    )
 
38
from bzrlib.trace import mutter
37
39
from bzrlib.transport import LateReadError
38
40
""")
39
41
 
72
74
 
73
75
        super(LocalTransport, self).__init__(base)
74
76
        self._local_base = urlutils.local_path_from_url(base)
75
 
        if self._local_base[-1] != '/':
76
 
            self._local_base = self._local_base + '/'
77
77
 
78
78
    def clone(self, offset=None):
79
79
        """Return a new LocalTransport with root at self.base + offset
329
329
 
330
330
    def open_write_stream(self, relpath, mode=None):
331
331
        """See Transport.open_write_stream."""
 
332
        # initialise the file
 
333
        self.put_bytes_non_atomic(relpath, "", mode=mode)
332
334
        abspath = self._abspath(relpath)
333
 
        try:
334
 
            handle = osutils.open_file(abspath, 'wb')
335
 
        except (IOError, OSError),e:
336
 
            self._translate_error(e, abspath)
337
 
        handle.truncate()
 
335
        handle = osutils.open_file(abspath, 'wb')
338
336
        if mode is not None:
339
337
            self._check_mode_and_size(abspath, handle.fileno(), mode)
340
338
        transport._file_streams[self.abspath(relpath)] = handle