~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

[merge] win32

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
from bzrlib.trace import mutter
28
28
from bzrlib.transport import Transport
29
 
from bzrlib.osutils import abspath
 
29
from bzrlib.osutils import abspath, realpath, normpath, pathjoin, rename
30
30
 
31
31
 
32
32
class LocalTransport(Transport):
38
38
            base = base[7:]
39
39
        # realpath is incompatible with symlinks. When we traverse
40
40
        # up we might be able to normpath stuff. RBC 20051003
41
 
        super(LocalTransport, self).__init__(
42
 
            os.path.normpath(abspath(base)))
 
41
        super(LocalTransport, self).__init__(normpath(abspath(base)))
43
42
 
44
43
    def should_cache(self):
45
44
        return False
59
58
        This can be supplied with a string or a list
60
59
        """
61
60
        assert isinstance(relpath, basestring), (type(relpath), relpath)
62
 
        return os.path.join(self.base, urllib.unquote(relpath))
 
61
        return pathjoin(self.base, urllib.unquote(relpath))
63
62
 
64
63
    def relpath(self, abspath):
65
64
        """Return the local path portion from a given absolute path.
148
147
        path_to = self.abspath(rel_to)
149
148
 
150
149
        try:
151
 
            os.rename(path_from, path_to)
 
150
            rename(path_from, path_to)
152
151
        except (IOError, OSError),e:
153
152
            # TODO: What about path_to?
154
153
            self._translate_error(e, path_from)