~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Vincent Ladeuil
  • Date: 2011-06-15 11:36:05 UTC
  • mto: This revision was merged to the branch mainline in revision 5975.
  • Revision ID: v.ladeuil+lp@free.fr-20110615113605-p7zyyfry9wy1hquc
Make ContentConflict resolution more robust

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
        super(LocalTransport, self).__init__(base)
74
74
        self._local_base = urlutils.local_path_from_url(base)
75
 
        if self._local_base[-1] != '/':
76
 
            self._local_base = self._local_base + '/'
77
75
 
78
76
    def clone(self, offset=None):
79
77
        """Return a new LocalTransport with root at self.base + offset
329
327
 
330
328
    def open_write_stream(self, relpath, mode=None):
331
329
        """See Transport.open_write_stream."""
 
330
        # initialise the file
 
331
        self.put_bytes_non_atomic(relpath, "", mode=mode)
332
332
        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()
 
333
        handle = osutils.open_file(abspath, 'wb')
338
334
        if mode is not None:
339
335
            self._check_mode_and_size(abspath, handle.fileno(), mode)
340
336
        transport._file_streams[self.abspath(relpath)] = handle
567
563
        self._local_base = urlutils._win32_local_path_from_url(base)
568
564
 
569
565
    def abspath(self, relpath):
570
 
        path = osutils._win32_normpath(osutils.pathjoin(
 
566
        path = osutils.normpath(osutils.pathjoin(
571
567
                    self._local_base, urlutils.unescape(relpath)))
572
568
        return urlutils._win32_local_path_to_url(path)
573
569